【发布时间】:2019-04-07 13:33:59
【问题描述】:
我正在尝试向网站请求该请求有效并且我可以加载它
但我试图从该网站获取的内容并没有从那里的服务器恢复,如下所示:
我该如何解决这个问题?
代码:
import requests
from bs4 import BeautifulSoup
res = requests.get('https://9xbuddy.com/process?url=https://streamango.com/embed/accssmlbkfmmsrcd')
soup = BeautifulSoup(res.text, 'html.parser')
links = [items.get('href') for items in soup.find_all('a', {'class': 'leading-normal sm:leading-none block sm:inline-block bg-blue px-6 sm:px-12 lg:px-6 py-2 text-white no-underline shadow hover:opacity-75'})]
print(links) #[] page sill loading
【问题讨论】:
-
使用像 selenium 这样的方法来自动化浏览器
-
能否请您发布您的代码
-
你需要找到真正包含你想要的数据的请求。然后直接请求。始终使用
selenium作为最后的手段。
标签: python-3.x beautifulsoup python-requests