我正在尝试使用 requests_html 和 CSS 选择器从 This Website 中抓取应用程序名称(存在于网站底部),但它返回空列表,您能帮忙解释一下吗? 代码:
import requests_html
from requests_html import HTMLSession
s = HTMLSession()
headers = {
"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36"
}
url = 'https://www.workato.com/integrations/salesforce'
r = s.get(url, headers=headers)
r.html.render(sleep=4)
apps = r.html.find('#__layout > div > div > div > div > div > main > article.apps-page__section.apps-page__section_search > div > div > div.apps-page__integrations > div > ul')
print(apps)
我试过以下方法:
for app in apps:
print(app)
我也用过
.text
但输出总是:
[]