Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/317.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 刮削亚马逊交易第40页产品,但得到15个产品_Python_Selenium_Web Scraping_Beautifulsoup - Fatal编程技术网

Python 刮削亚马逊交易第40页产品,但得到15个产品

Python 刮削亚马逊交易第40页产品,但得到15个产品,python,selenium,web-scraping,beautifulsoup,Python,Selenium,Web Scraping,Beautifulsoup,我想从amazon的deals页面中刮取所有产品(40个),但只得到16个。我搜索了很多次,发现我应该使用scroll,但我得到了相同的值,scroll不起作用 代码 您可以使用下面的css获取全部40个项目 div[class^='a-section a-spacing-none tallCellView gridColumn'] # below is the line to get all the products soup.select("div[class^='a-section a-s

我想从amazon的deals页面中刮取所有产品(40个),但只得到16个。我搜索了很多次,发现我应该使用scroll,但我得到了相同的值,scroll不起作用

代码


您可以使用下面的css获取全部40个项目

div[class^='a-section a-spacing-none tallCellView gridColumn']
# below is the line to get all the products
soup.select("div[class^='a-section a-spacing-none tallCellView gridColumn']")
屏幕截图:


你说的“显示”是什么意思?你可以使用
soup。如果你想选择基于css的项目,请选择
。我的英语不好(我指的是你在图片底部提到的屏幕截图中的部分)检查帖子。您可以尝试使用css,而不是使用xpath,正如我在上面的屏幕截图中提到的那样。
div[class^='a-section a-spacing-none tallCellView gridColumn']
# below is the line to get all the products
soup.select("div[class^='a-section a-spacing-none tallCellView gridColumn']")