python - lxml html ubnable to parse display block
问题描述
I'm trying to scrape this website - of dutyfree product and get a list of choclate products, but actually i'm only getting nothing..
- my code:
from lxml import html
import lxml.html
import requests
import lxml
tree = html.fromstring(url.content)
data_price = tree.xpath('//div[@class="main"]/div[1]/div[1]/div[1]')
for item in data_price:
print(lxml.html.tostring(item))
- f12 telling something about blocing the display
解决方案
推荐阅读
- node.js - 将 JS 注入到具有匹配文件名的 HTML 页面中
- php - 允许客户在 WooCommerce 中更改订单状态
- node.js - 控制台中的节点打印 [Circular]
- torch - 我找不到使用 torch.autograd.set_detect_anomaly(True) 的就地操作
- javascript - 一旦反应应用程序状态改变,谷歌地图不会更新
- python - 如何更改代码以获取 IoU 值?
- reactjs - 如何使用功能组件和 react-redux 取消订阅 firebase?
- kubernetes - 错误:Kubernetes 集群无法访问:获取“http://localhost:8080/version?timeout=32s”:拨打 tcp 127.0.0.1:8080:连接:连接被拒绝
- excel - 使用 VBA 在用户窗体上生成组合框和编辑文本框
- java - 无法在主要 java 方法中接受用户输入