Is it possible to pull information from a specific site in an excel site?

Asked

Viewed 123 times

1

My question is this... I got a topdesk call. I would like to pull information like opening date and completion and status (open, closed, solved)... I was wondering if in excel there is a way I do this procedure.

It’s the same concept we use with Python Selenium to do this. Example: inserir a descrição da imagem aqui

When placing the ID, it pulls the status, opening date, etc... Pull html < li > something etc...

  • This can be done by Selenium in Python and then insert the data into Excel, or create a CSV and import by Excel. Or use Selenium VBA. Behold this question

1 answer

0

Yes, using VBA in Excel. (If you do not know, comment that I explain much more detailed how to activate it and use the commands)

Create a Form, then a button.

Click Tools and then References and activate the following options "Microsoft Html Object Library" and "Microsoft xml".

Now double-click the button and enter the following code:

'Iniciando variaveis
Dim http As New XMLHTTP60, html As New HTMLDocument
Dim source As Object

With http
     'Open(método, url, usuario(se necessario), senha(se necessario))
    .Open "GET", "http://www.brazil4export.com/en/pesquisa/resultado/?page=1&", False
    .send
    html.body.innerHTML = .responseText
End With
'Um loop para pegar informações de um elemento
For Each source In html.getElementsByClassName("panel-heading")
    x = x + 1: Cells(x, 1) = source.getAttribute("data-Name")
    Cells(x, 2) = source.getAttribute("data-site")
Next source

Now just study this code and shape it to your needs. Test it like this and see it working.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.