Reputation: 3
Web page (about football and ratings) :
What i tried:
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
Upvotes: 0
Views: 147
Reputation: 17074
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
Upvotes: 1