【发布时间】:2017-02-16 23:04:15
【问题描述】:
我正在尝试从链接的搜索页面获取公司的行业。我从 Chrome 的开发工具中获取 xpath,但它返回空括号。这里似乎有什么问题?
from lxml import html
import requests
page = requests.get('https://www.linkedin.com/search/results/companies/?keywords=cisco.com')
tree = html.fromstring(page.content)
industry = tree.xpath('//*[@id="ember3734"]/div/div[1]/p[1]')
print(industry)
【问题讨论】:
标签: python html xml parsing lxml