how to copy data from aspx website

nivas143

New Member
Joined
Jun 27, 2014
Messages
6
Hi Guys,

I would like to write a macro to download information related to 579 companies mentioned as exhibitors
URL: Event Map

Could some one help plz
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
You can get the table via Data>From Web.
 
Upvote 0
There is no code, goto Data>From Web, enter the URL for the page, select the table and click Import.
 
Upvote 0
There is no code, goto Data>From Web, enter the URL for the page, select the table and click Import.
Hi there are around 500+ companies in this website and each information would get displayed after selecting the each company.

Could you please provide a code to automate this and download all the company in a go.

I am actually trying something like this

Dim IE As Object
Sub ASP_Download()


Dim Doc As Object, lastRow As Long, tblTR As Object
Set IE = CreateObject("internetexplorer.application")
IE.Visible = True

navigate:
IE.navigate "Event Map"

Do While IE.readystate <> 4: DoEvents: Loop

Set Doc = CreateObject("htmlfile")
Set Doc = IE.document

If Doc Is Nothing Then GoTo navigate



lastRow = Sheet1.Range("A65000").End(xlUp).row
If lastRow < 5 Then Exit Sub

For i = 5 To lastRow

Set company = Doc.getelementbyid("ctl00_ctl00_cph1_cph1_ucExhibitorList_dockExhibitorList_C_radExhibitorList_ctl00")
For x = 0 To 250

If company.Options(x).Text = Sheet1.Range("B" & i) Then
company.selectedIndex = x

Set btnCompanyAdd = Doc.getelementbyid("ctl00_ctl00_cph1_cph1_ucExhibitorList_dockExhibitorList_C_radExhibitorList_ctl00_1")
btnCompanyAdd.Click
Set btnCompanyAdd = Nothing

wait
Exit For
End If
Next
Next


wait

Set btnSubmit = Doc.getelementbyid("btnSubmit")
btnSubmit.Click

wait

Set tbldgFunds = Doc.getelementbyid("dgFunds")
Set tblTR = tbldgFunds.getelementsbytagname("tr")



Dim row As Long, col As Long
row = 1
col = 1

On Error Resume Next

For Each r In tblTR

If row = 1 Then
For Each cell In r.getelementsbytagname("th")
Sheet2.Cells(row, col) = cell.innerText
col = col + 1
Next
row = row + 1
col = 1
Else
For Each cell In r.getelementsbytagname("td")
Sheet2.Cells(row, col) = cell.innerText
col = col + 1
Next
row = row + 1
col = 1
End If
Next

IE.Quit
Set IE = Nothing

MsgBox "Done"

End Sub

Sub wait()
Application.wait Now + TimeSerial(0, 0, 10)
Do While IE.readystate <> 4: DoEvents: Loop
End Sub
 
Upvote 0
I think you need to clarify what data you actually want to get.
 
Upvote 0
I think you need to clarify what data you actually want to get.
Sorry for taking your time, I am briefing my requirement in the below

IN the website there are list of 500+ companies


5DFFHJe

After selecting each company there would be a popup with the details of the company
HhU9kdy

I need to copy all the information and paste in an excel file.

Could you help
 
Upvote 0
Upvote 0

Forum statistics

Threads
1,215,575
Messages
6,125,613
Members
449,238
Latest member
wcbyers

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top