我正在使用BeautifulSoup和Requests刮取allrecipes用户数据。Requests.content与Chrome检测元素不匹配
当检查HTML代码,我发现我想要的数据是包含在
<article class="profile-review-card">
然而,当我使用下面的代码
URL = 'http://allrecipes.com/cook/2010/reviews/'
response = requests.get(URL).content
soup = BeautifulSoup(response, 'html.parser')
X = soup.find_all('article', class_ = "profile-review-card" )
虽然汤和响应都充满HTML,X的是空的。我仔细看过,并且在我看到的inspect元素和requests.get(URL).content之间存在一些不一致之处,这是怎么回事?
感谢您的回答,硒工作了巨大的。在将来如何识别网站正在加载Ajax/JavaScript? –