0

Web page (about football and ratings) :

http://www.fantagazzetta.com/voti-serie-a

What i tried:

How to extract text from html page?

I tried using the code provided by the user JRodDynamite in his answer (and in the end just printing res and not doing the for thing). So i needed to edit just this part of the code (i guess):

res = soup.findAll("article", {"class": "listingItem"}) 

To print each table's content i thought the answer was:

res = soup.findAll("table", {"class": "table"}) 

But it's not printing anything. So I need your help: i would like to collect the data from that web page (player's name and rating) but i'm stuck on this point. Thanks

0

1 Answer 1

1

BeautifulSoup, requests, etc. does not execute Javascript, so any data delivered or rendered via JS will not be available to you.

For JavaScript rendered pages you can try with dryscrape like so:

import dryscrape from bs4 import BeautifulSoup sess = dryscrape.Session() sess.visit('http://www.fantagazzetta.com/voti-serie-a#') s = BeautifulSoup(sess.body()) for a in s.find_all('table', {'class': 'table'}): print(a.text) 

Dryscrape installation:

sudo pip install dryscrape 
Sign up to request clarification or add additional context in comments.

1 Comment

you could describe dryscrape for OP and others. Link to documentation could be nice too.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.