即使屏幕刮板的路径正确,列表也将返回空

因此,即时通讯试图从Ubisoft网站上的免费游戏网站获取所有网址,但该网址一直返回空白。我不知道我在做什么错,下图显示了路径

headers = {
    "User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0",
}

result = requests.get("https://free.ubisoft.com/", headers=headers)
soup = BeautifulSoup(result.content, 'lxml')
print(result.content)
urls = []
urls = soup.find('div', {'class': 'free-events'}).find_all("a")
for url in urls:

    link = url.attrs['data-url']
    if "https" in link:
        links.append(link)

return links

enter image description here

评论