diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\345\230\230\345\230\230/1\347\217\255_\345\230\230\345\230\230_\347\254\254\344\271\235\345\221\250_\344\275\234\344\270\232/1\347\217\255_\345\230\230\345\230\230_\347\254\254\344\271\235\345\221\250_\347\254\254\344\270\211\350\212\202\350\257\276\344\275\234\344\270\232/search.py" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\345\230\230\345\230\230/1\347\217\255_\345\230\230\345\230\230_\347\254\254\344\271\235\345\221\250_\344\275\234\344\270\232/1\347\217\255_\345\230\230\345\230\230_\347\254\254\344\271\235\345\221\250_\347\254\254\344\270\211\350\212\202\350\257\276\344\275\234\344\270\232/search.py" deleted file mode 100644 index 46dbcb2904d783ebbbcac57204ca2bfea52b6d85..0000000000000000000000000000000000000000 --- "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\345\230\230\345\230\230/1\347\217\255_\345\230\230\345\230\230_\347\254\254\344\271\235\345\221\250_\344\275\234\344\270\232/1\347\217\255_\345\230\230\345\230\230_\347\254\254\344\271\235\345\221\250_\347\254\254\344\270\211\350\212\202\350\257\276\344\275\234\344\270\232/search.py" +++ /dev/null @@ -1,33 +0,0 @@ -from bs4 import BeautifulSoup -import json - -def parse_jd_item(html): - result = [] - - soup = BeautifulSoup(html, "lxml") - item_array = soup.select("ul[class='gl-warp clearfix'] li[class='gl-item']") - for item in item_array: - sku_id = item.attrs["data-sku"] - img = item.select("img[data-img='1']") - price = item.select("div[class='p-price']") - title = item.select("div[class='p-name p-name-type-2']") - shop = item.select("div[class='p-shop']") - icons = item.select("div[class='p-icons']") - - img = img[0].attrs['data-lazy-img'] if img else "" - price = price[0].strong.i.text if price else "" - title = title[0].text.strip() if title else "" - shop = shop[0].span.a.attrs['title'] if shop[0].text.strip() else "" - icons = json.dumps([tag_ele.text for tag_ele in icons[0].select("i")]) if icons else '[]' - - result.append((sku_id, img, price, title, shop, icons)) - - return result - - - -if __name__ == "__main__": - with open("search.html", "r", encoding="utf_8") as f: - html = f.read() - result = parse_jd_item(html) - print(result) diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\345\230\230\345\230\230/1\347\217\255_\345\230\230\345\230\230_\347\254\254\345\215\201\344\270\203\345\221\250_\344\275\234\344\270\232/1\347\217\255_\345\230\230\345\230\230_\347\254\254\344\270\211\350\212\202\350\257\276_\344\275\234\344\270\232/\347\273\203\344\271\2401.png" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\345\230\230\345\230\230/1\347\217\255_\345\230\230\345\230\230_\347\254\254\345\215\201\344\270\203\345\221\250_\344\275\234\344\270\232/1\347\217\255_\345\230\230\345\230\230_\347\254\254\344\270\211\350\212\202\350\257\276_\344\275\234\344\270\232/\347\273\203\344\271\2401.png" new file mode 100644 index 0000000000000000000000000000000000000000..371faca8a3f3add6ebb4492dbdf2376dedfabd7d Binary files /dev/null and "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\345\230\230\345\230\230/1\347\217\255_\345\230\230\345\230\230_\347\254\254\345\215\201\344\270\203\345\221\250_\344\275\234\344\270\232/1\347\217\255_\345\230\230\345\230\230_\347\254\254\344\270\211\350\212\202\350\257\276_\344\275\234\344\270\232/\347\273\203\344\271\2401.png" differ diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\345\230\230\345\230\230/1\347\217\255_\345\230\230\345\230\230_\347\254\254\345\215\201\344\270\203\345\221\250_\344\275\234\344\270\232/1\347\217\255_\345\230\230\345\230\230_\347\254\254\344\270\211\350\212\202\350\257\276_\344\275\234\344\270\232/\347\273\203\344\271\2402.png" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\345\230\230\345\230\230/1\347\217\255_\345\230\230\345\230\230_\347\254\254\345\215\201\344\270\203\345\221\250_\344\275\234\344\270\232/1\347\217\255_\345\230\230\345\230\230_\347\254\254\344\270\211\350\212\202\350\257\276_\344\275\234\344\270\232/\347\273\203\344\271\2402.png" new file mode 100644 index 0000000000000000000000000000000000000000..b3d231b979c9ec1614140809ddf9674cd19c3e0b Binary files /dev/null and "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\345\230\230\345\230\230/1\347\217\255_\345\230\230\345\230\230_\347\254\254\345\215\201\344\270\203\345\221\250_\344\275\234\344\270\232/1\347\217\255_\345\230\230\345\230\230_\347\254\254\344\270\211\350\212\202\350\257\276_\344\275\234\344\270\232/\347\273\203\344\271\2402.png" differ diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\345\230\230\345\230\230/1\347\217\255_\345\230\230\345\230\230_\347\254\254\345\215\201\344\270\203\345\221\250_\344\275\234\344\270\232/1\347\217\255_\345\230\230\345\230\230_\347\254\254\344\270\211\350\212\202\350\257\276_\344\275\234\344\270\232/\347\273\203\344\271\2403.png" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\345\230\230\345\230\230/1\347\217\255_\345\230\230\345\230\230_\347\254\254\345\215\201\344\270\203\345\221\250_\344\275\234\344\270\232/1\347\217\255_\345\230\230\345\230\230_\347\254\254\344\270\211\350\212\202\350\257\276_\344\275\234\344\270\232/\347\273\203\344\271\2403.png" new file mode 100644 index 0000000000000000000000000000000000000000..d0221cb0bac244d5e351330f684a1f547de3ff60 Binary files /dev/null and "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\345\230\230\345\230\230/1\347\217\255_\345\230\230\345\230\230_\347\254\254\345\215\201\344\270\203\345\221\250_\344\275\234\344\270\232/1\347\217\255_\345\230\230\345\230\230_\347\254\254\344\270\211\350\212\202\350\257\276_\344\275\234\344\270\232/\347\273\203\344\271\2403.png" differ diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\345\230\230\345\230\230/1\347\217\255_\345\230\230\345\230\230_\347\254\254\345\215\201\344\270\203\345\221\250_\344\275\234\344\270\232/1\347\217\255_\345\230\230\345\230\230_\347\254\254\344\270\211\350\212\202\350\257\276_\344\275\234\344\270\232/\347\273\203\344\271\2404.png" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\345\230\230\345\230\230/1\347\217\255_\345\230\230\345\230\230_\347\254\254\345\215\201\344\270\203\345\221\250_\344\275\234\344\270\232/1\347\217\255_\345\230\230\345\230\230_\347\254\254\344\270\211\350\212\202\350\257\276_\344\275\234\344\270\232/\347\273\203\344\271\2404.png" new file mode 100644 index 0000000000000000000000000000000000000000..3037641532c61c72ab5d8b5bc96587fd52e32b50 Binary files /dev/null and "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\345\230\230\345\230\230/1\347\217\255_\345\230\230\345\230\230_\347\254\254\345\215\201\344\270\203\345\221\250_\344\275\234\344\270\232/1\347\217\255_\345\230\230\345\230\230_\347\254\254\344\270\211\350\212\202\350\257\276_\344\275\234\344\270\232/\347\273\203\344\271\2404.png" differ diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\345\230\230\345\230\230/1\347\217\255_\345\230\230\345\230\230_\347\254\254\345\215\201\344\270\203\345\221\250_\344\275\234\344\270\232/1\347\217\255_\345\230\230\345\230\230_\347\254\254\344\270\211\350\212\202\350\257\276_\344\275\234\344\270\232/\347\273\203\344\271\2405.png" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\345\230\230\345\230\230/1\347\217\255_\345\230\230\345\230\230_\347\254\254\345\215\201\344\270\203\345\221\250_\344\275\234\344\270\232/1\347\217\255_\345\230\230\345\230\230_\347\254\254\344\270\211\350\212\202\350\257\276_\344\275\234\344\270\232/\347\273\203\344\271\2405.png" new file mode 100644 index 0000000000000000000000000000000000000000..13c6f3df658a29c7c2ad6943a1752f53f63ccce6 Binary files /dev/null and "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\345\230\230\345\230\230/1\347\217\255_\345\230\230\345\230\230_\347\254\254\345\215\201\344\270\203\345\221\250_\344\275\234\344\270\232/1\347\217\255_\345\230\230\345\230\230_\347\254\254\344\270\211\350\212\202\350\257\276_\344\275\234\344\270\232/\347\273\203\344\271\2405.png" differ diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\345\230\230\345\230\230/1\347\217\255_\345\230\230\345\230\230_\347\254\254\345\215\201\344\270\203\345\221\250_\344\275\234\344\270\232/1\347\217\255_\345\230\230\345\230\230_\347\254\254\344\270\211\350\212\202\350\257\276_\344\275\234\344\270\232/\347\273\203\344\271\2406.png" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\345\230\230\345\230\230/1\347\217\255_\345\230\230\345\230\230_\347\254\254\345\215\201\344\270\203\345\221\250_\344\275\234\344\270\232/1\347\217\255_\345\230\230\345\230\230_\347\254\254\344\270\211\350\212\202\350\257\276_\344\275\234\344\270\232/\347\273\203\344\271\2406.png" new file mode 100644 index 0000000000000000000000000000000000000000..434ff199fc4af2e3032954757933498a704f3296 Binary files /dev/null and "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\345\230\230\345\230\230/1\347\217\255_\345\230\230\345\230\230_\347\254\254\345\215\201\344\270\203\345\221\250_\344\275\234\344\270\232/1\347\217\255_\345\230\230\345\230\230_\347\254\254\344\270\211\350\212\202\350\257\276_\344\275\234\344\270\232/\347\273\203\344\271\2406.png" differ diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\345\230\230\345\230\230/1\347\217\255_\345\230\230\345\230\230_\347\254\254\345\215\201\344\270\203\345\221\250_\344\275\234\344\270\232/1\347\217\255_\345\230\230\345\230\230_\347\254\254\344\270\211\350\212\202\350\257\276_\344\275\234\344\270\232/\347\273\203\344\271\2407.png" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\345\230\230\345\230\230/1\347\217\255_\345\230\230\345\230\230_\347\254\254\345\215\201\344\270\203\345\221\250_\344\275\234\344\270\232/1\347\217\255_\345\230\230\345\230\230_\347\254\254\344\270\211\350\212\202\350\257\276_\344\275\234\344\270\232/\347\273\203\344\271\2407.png" new file mode 100644 index 0000000000000000000000000000000000000000..254d056bb8c8633729cb330b9f8d4693c96c65b6 Binary files /dev/null and "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\345\230\230\345\230\230/1\347\217\255_\345\230\230\345\230\230_\347\254\254\345\215\201\344\270\203\345\221\250_\344\275\234\344\270\232/1\347\217\255_\345\230\230\345\230\230_\347\254\254\344\270\211\350\212\202\350\257\276_\344\275\234\344\270\232/\347\273\203\344\271\2407.png" differ