Get table from website with password

Danym

New Member
Joined
Dec 16, 2016
Messages
2
Hello guys. I'm trying to get automatically the data from this website.

http://www.visualchart.com/esxx/strategies/exchanges/symbols/symbols.asp?mercado=0003&isin=&codigo=&tiposimbolo=V&descrip=&buscar=1&image=Consultar

This is the first sheet of the website, I would like to get the data from the table from page 1 to 384 automatically.

Each time I click this link It changes to the next page.

http://www.visualchart.com/esxx/strategies/exchanges/symbols/symbols.asp?opcion=Simbolos&Direccion=Siguiente&buscar=1&mercado=0003&codigo=&descrip=&isin=&contienecodigo=&contienedescripcion=&contieneisin=&tiposimbolo=V

I have tried to import data inside excel, but it request a user and password.

I have looked for a macro and found one that obtain the data, but the problem is that I don't know how to write a macro that reproduces that table on my excel and that takes the information from page 1 to 384 automatically.

This is the code that I have until now.


Code:
[COLOR=black !important][FONT=-apple-system]Sub ObtenerDatosDesdeLaWeb()

Dim htmlDeRespuesta As Object, contadorFilas As Long, contadorColumnas As Long

Set htmlDeRespuesta = CreateObject("htmlFile")

With CreateObject("msxml2.xmlhttp")

    .Open "GET", "[/FONT][/COLOR][COLOR=black !important][FONT=-apple-system][URL="http://www.visualchart.com/esxx/strategies/exchanges/symbols/symbols.asp?mercado=0003&isin=&codigo=&tiposimbolo=V&descrip=&buscar=1&image=Consultar"]http://www.visualchart.com/esxx/strategies/exchanges/symbols/symbols.asp?mercado=0003&isin=&codigo=&tiposimbolo=V&descrip=&buscar=1&image=Consulta[/URL]r[/FONT][/COLOR][COLOR=black !important][FONT=-apple-system]", False
    .send
    htmlDeRespuesta.body.innerhtml = .responsetext
End With

With htmlDeRespuesta.GetElementsByTagName("table")(0)

For contadorFilas = 0 To .Rows.Length - 1

    For contadorColumnas = 0 To .Rows(contadorFilas).Cells.Length - 1
    
       Sheets(1).Cells(contadorFilas + 1, contadorColumnas + 1).Value = .Rows(contadorFilas).Cells(contadorColumnas).innertext
    
    Next
    
Next

End With

End Sub[/FONT][/COLOR]

Please help!! :)
 

Some videos you may like

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.

Danym

New Member
Joined
Dec 16, 2016
Messages
2
I don't know why those COLOR words appeared :/ Sorry I can't edit!
 

Watch MrExcel Video

Forum statistics

Threads
1,122,232
Messages
5,594,956
Members
413,954
Latest member
mrsandy

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
Top