Techiio-author
Started by Allen ScottOct 31, 2021

Open
Element find_all is not evaluated in web scraping

1 VIEWES 0 LIKES 0 DISLIKES SHARE
0 LIKES 0 DISLIKES 1 VIEWES SHARE

This code doesn't work but I don't understand what is this reason?

Could you give me a hand?

import requests

from bs4 import BeautifulSoup

from pprint import pprint

URL = "https://www.diretta.it/calcio/inghilterra/premier-league/classifiche/"

r = requests.get(URL)

r.raise_for_status()

soup = BeautifulSoup(r.text, 'html.parser')

data = []

row = soup.find_all('class', attrs={'ui-table__row'})

element = row.find('tableCellParticipant__name')

for element in elements:

data.append(element.text)

pprint(data)

0 Replies

You must be Logged in to reply
Techiio-logo

Techiio is on the journey to build an ocean of technical knowledge, scouring the emerging stars in process and proffering them to the corporate world.

Follow us on:

Subscribe to get latest updates

You can unsubscribe anytime from getting updates from us
Developed and maintained by Wikiance
Developed and maintained by Wikiance