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!! :)
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.

Forum statistics

Threads
1,215,046
Messages
6,122,855
Members
449,096
Latest member
Erald

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