Python 源代码中没有特定的刮取数据

Python 源代码中没有特定的刮取数据,python,beautifulsoup,python-requests,Python,Beautifulsoup,Python Requests,我正试图抓取一个特定的网站slader,并在一个特定的div中获取图像,解决方案内容。我正在使用请求和BeautifulSoup,但问题是源代码没有解决方案。有没有办法得到这样的图像 供您参考的URL:请尝试以下操作: from bs4 import BeautifulSoup from selenium import webdriver from selenium.webdriver.chrome.options import Options option = Options() opti

我正试图抓取一个特定的网站slader,并在一个特定的div中获取图像,
解决方案内容
。我正在使用请求和BeautifulSoup,但问题是源代码没有解决方案。有没有办法得到这样的图像

供您参考的URL:

请尝试以下操作:

from bs4 import BeautifulSoup

from selenium import webdriver
from selenium.webdriver.chrome.options import Options

option = Options()
option.add_argument('--headless')
url = 'https://www.slader.com/textbook/9780321696724-chemistry-the-central-science-12th-edition/694/exercises/1a/'
driver = webdriver.Chrome(options=option)
driver.get(url)
bs = BeautifulSoup(driver.page_source, 'html.parser')
print(bs.find_all('div', {'class': 'solution-content'}))
driver.quit()

问题和答案由Javascript填写。这就好像他们不想让你做你正在做的事情,这当然是真的。是的,但是有没有办法解决这个问题呢?我可以建议使用selenium webdriver来获取页面内容哇,谢谢@阿比德拉希德也谢谢你