Question

Web scraping

  • 4 July 2023
  • 5 replies
  • 36 views

Userlevel 1
Badge +11

Hi

can you hlep me to understand if I can extract info from this webpage

 

https://viabilita.autostrade.it/it/viabilita/previsioni

What I need is the info in the blue box

thx

Francesco

image 


5 replies

Userlevel 5
Badge +29

It looks like this url, https://viabilita.autostrade.it/json/previsioni.json, will return the results in JSON format

Userlevel 1
Badge +11

Hi thx

 

can you also help me to understand how can extract the value for this website inside tbody tr, I don't know how to handle the id

#ID15762803 > td:nth-child(1) > a

https://alboonline.comune.genova.it/albopretorio/#/albo/140

 

thx

 

Francesco

 

Userlevel 5
Badge +29

Hi thx

 

can you also help me to understand how can extract the value for this website inside tbody tr, I don't know how to handle the id

#ID15762803 > td:nth-child(1) > a

https://alboonline.comune.genova.it/albopretorio/#/albo/140

 

thx

 

Francesco

 

This one (like the original) requests data from an API. When you use an HTML Reader/Extractor you get the webpage before the API call is made. All it returns is the JS code to make those calls - in other words, there is no data in the raw HTML.

 

To get the API calls, you need to open up Developer Tools and have a look at the network requests and figure out what call is return the data you need. In this case, the url that will return the data (in JSON) is:

https://alboonline.comune.genova.it/albopretorio/dispatcher/alboPretorioServlet/invoke

Userlevel 1
Badge +11

Hi,

 

sorry to bother you but I'not a programmer and I'm trying to understand but every website is different .....

 

here https://serviziweb.comune.avellino.it/kweb/ap/avellino?npage=0 I received the HTML with the data but I'm not able to extract the data

 

this my css div:nth-child(2)> div > div > div > div:nth-child(-n+10) > div > h3 > span ..but no results

 

thx for help

 

 

Francesco

Userlevel 5
Badge +29

Hi,

 

sorry to bother you but I'not a programmer and I'm trying to understand but every website is different .....

 

here https://serviziweb.comune.avellino.it/kweb/ap/avellino?npage=0 I received the HTML with the data but I'm not able to extract the data

 

this my css div:nth-child(2)> div > div > div > div:nth-child(-n+10) > div > h3 > span ..but no results

 

thx for help

 

 

Francesco

Whilst you can pull information out of the HTML (and my preference in this instance would be using the HTML Table reader) it isn't pretty. I'd be reaching out the the local council (making an assumption here as I don't know Italian(?)) and asking if they have an API that can deliver this data.

 

It will make things a lot easier

Reply