爬蟲抓取商品價格與商品名,來個大佬教一下

2021-10-18 06:37:10 字數 340 閱讀 3224

自己嘗試python爬蟲抓取商品資訊,抓取到了商品資訊存放地方的網頁原始碼然後怎麼繼續抓取商品**與商品

這個是抓取商品資訊存放原始碼的**

import requests

from bs4 import beautifulsoup

url = 『

req = requests.get(url)

html = req.text

bf = beautifulsoup(html)

div_data = bf.find_all(『div』,class_=『product-list』)

print(div_data)

這個是抓取到的

序號 商品名稱 商品價格

goods 要求 1 頁面顯示 序號 商品名稱 商品 如 1 電腦1999 2 滑鼠10 2 使用者輸入選擇的商品序號,然後列印商品名稱及商品 3 如果使用者輸入的商品序號有誤,則提示輸入有誤,並重新輸入。4 使用者輸入q或者q,退出程式。goods while 1 for i in range l...

selenium爬取京東商品名與價格

簡單實現自動化模擬人爬取京東,當然這爬不了 有自動化爬取監測 import time from selenium import webdriver from lxml import html etree html.etree 建立物件 browner webdriver.chrome browner...

修改商品價格

author jonathon software pycharm community edition time 2017 10 2915 53 import json new product mod product data while true selected input add 新增商品,mo...