I am trying to scrape data from https://www.transfermarkt.co.uk/premier-league/startseite/wettbewerb/GB1
I have used this code to do so:
headers = {'User-Agent':
'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36'}
page = 'https://www.transfermarkt.co.uk/premier-league/startseite/wettbewerb/GB1'
pageTree = requests.get(page, headers=headers)
pageTree_text = pageTree.text
pageSoup = BeautifulSoup(pageTree_text, 'html.parser')
After, I want to find all the links that is connected to each team name, and use this code:
linkLocation = pageSoup.find_all("a", {"class": "vereinprofil_tooltip tooltipstered"})
linkLocation[0].text
output:
IndexError Traceback (most recent call last) in 1 linkLocation = pageSoup.find_all("a", {"class": "vereinprofil_tooltip tooltipstered"}) ----> 2 linkLocation[0].text
IndexError: list index out of range
Why doesn`t the list have any of the links within it?
Thnx in advcance!