Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/python-2.7/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 2.7 用Python don'抓取Aliexpress站点;我不能给我正确的结果_Python 2.7_Web Scraping - Fatal编程技术网

Python 2.7 用Python don'抓取Aliexpress站点;我不能给我正确的结果

Python 2.7 用Python don'抓取Aliexpress站点;我不能给我正确的结果,python-2.7,web-scraping,Python 2.7,Web Scraping,我在抓取aliexpress站点时遇到问题 这是一个url 我想要的 美丽之群 content = soup.find('div', {'id':'j-product-tabbed-pane'}) lxml解析 root = html.fromstring(r.content) results = root.xpath('//img[@alt="aeProduct.getSubject()"]') f = open('result.html', 'w') f.write(lxml.htm

我在抓取aliexpress站点时遇到问题

这是一个url

我想要的

美丽之群

content = soup.find('div', {'id':'j-product-tabbed-pane'})
lxml解析

root = html.fromstring(r.content)
results = root.xpath('//img[@alt="aeProduct.getSubject()"]')
f =  open('result.html', 'w')
f.write(lxml.html.tostring(results[0]))
f.close()
这是我的代码,但给我错误的结果。 在浏览器上检查是否包含该元素 但是上面的代码没有给我任何信息

我认为你没有给我正确的内容。但我为什么以及如何解决这个问题。他们像机器人一样探测?。你能帮我什么忙。 谢谢大家。

试试这个 单用户代理 二用代理 3-从该站点禁用javascript并刷新它,然后查看该站点是否具有此元素,或者如果通过javascript加载,则通过javascript加载 您应该找到一种呈现JS的方法,试试这个 单用户代理 二用代理 3-从该站点禁用javascript并刷新它,然后查看该站点是否具有此元素,或者如果通过javascript加载,则通过javascript加载
你应该找到一种渲染JS的方法

你想让它只出现在美丽的汤中吗?你想让它只出现在美丽的汤中吗?
root = html.fromstring(r.content)
results = root.xpath('//img[@alt="aeProduct.getSubject()"]')
f =  open('result.html', 'w')
f.write(lxml.html.tostring(results[0]))
f.close()