Python 刮削亚马逊交易第40页产品,但得到15个产品
我想从amazon的deals页面中刮取所有产品(40个),但只得到16个。我搜索了很多次,发现我应该使用scroll,但我得到了相同的值,scroll不起作用 代码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
您可以使用下面的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']")