From 5aa279a70b8314aff94fda058682c4337c56e208 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E8=99=9A=E5=B9=B3?= <8437069+zhang-xuping@user.noreply.gitee.com> Date: Tue, 23 Feb 2021 22:40:09 +0800 Subject: [PATCH 1/4] init commit --- .../detailed information.html" | 0 .../search_keyword.html" | 0 .../test.py" | 53 +++++++++++++++++++ ...\344\270\272\346\211\213\346\234\272.html" | 0 ...\346\230\276\347\244\272\345\261\217.html" | 0 ...\346\270\270\346\210\217\346\234\272.html" | 0 ...\347\254\224\350\256\260\346\234\254.html" | 0 ...\346\236\234\346\211\213\346\234\272.html" | 0 ...\351\201\277\345\255\225\345\245\227.html" | 0 .../\351\274\240\346\240\207.html" | 0 10 files changed, 53 insertions(+) create mode 100644 "\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\200\350\212\202\350\257\276\344\275\234\344\270\232/detailed information.html" create mode 100644 "\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\200\350\212\202\350\257\276\344\275\234\344\270\232/search_keyword.html" create mode 100644 "\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\200\350\212\202\350\257\276\344\275\234\344\270\232/test.py" create mode 100644 "\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\200\350\212\202\350\257\276\344\275\234\344\270\232/\345\215\216\344\270\272\346\211\213\346\234\272.html" create mode 100644 "\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\200\350\212\202\350\257\276\344\275\234\344\270\232/\346\230\276\347\244\272\345\261\217.html" create mode 100644 "\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\200\350\212\202\350\257\276\344\275\234\344\270\232/\346\270\270\346\210\217\346\234\272.html" create mode 100644 "\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\200\350\212\202\350\257\276\344\275\234\344\270\232/\347\254\224\350\256\260\346\234\254.html" create mode 100644 "\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\200\350\212\202\350\257\276\344\275\234\344\270\232/\350\213\271\346\236\234\346\211\213\346\234\272.html" create mode 100644 "\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\200\350\212\202\350\257\276\344\275\234\344\270\232/\351\201\277\345\255\225\345\245\227.html" create mode 100644 "\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\200\350\212\202\350\257\276\344\275\234\344\270\232/\351\274\240\346\240\207.html" 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\200\350\212\202\350\257\276\344\275\234\344\270\232/detailed information.html" "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\200\350\212\202\350\257\276\344\275\234\344\270\232/detailed information.html" new file mode 100644 index 00000000..e69de29b 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\200\350\212\202\350\257\276\344\275\234\344\270\232/search_keyword.html" "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\200\350\212\202\350\257\276\344\275\234\344\270\232/search_keyword.html" new file mode 100644 index 00000000..e69de29b 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\200\350\212\202\350\257\276\344\275\234\344\270\232/test.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\200\350\212\202\350\257\276\344\275\234\344\270\232/test.py" new file mode 100644 index 00000000..15cb5f59 --- /dev/null +++ "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\200\350\212\202\350\257\276\344\275\234\344\270\232/test.py" @@ -0,0 +1,53 @@ +第一问:搜索页面请求 +import requests +from urllib.parse import quote, unquote + +def request_jd(keyword): + f = open(keyword + ".html", "w", encoding="utf-8") + url = "https://search.jd.com/Search" + params = { + "keyword": keyword + } + headers = { + "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36" + } + response = requests. get(url=url, params=params, headers=headers) + + print(response.text) + +if __name__ == "__main__": + request_jd("鼠标") + request_jd("显示屏") + request_jd("游戏机") + request_jd("笔记本") + request_jd("华为手机") + request_jd("苹果手机") + request_jd("避孕套") + + +第二问:详细页面请求 +from urllib.request import Request,urlopen +from urllib.parse import quote +import string +f = open("detailed information.html", "w", encoding="utf-8") +url = 'https://item.jd.com/1337248.html' +response = urlopen(quote(url,safe=string.printable)) +print(response) + + + + + + + +第三问:json练习 +import json +test_dict = { + "a": 1, + "b": ["1", 2, None], + "c": {"d":1} +} + +json_data = json.dumps(test_dict) +print(type(json_data), json_data) +print(json.loads(json_data)) 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\200\350\212\202\350\257\276\344\275\234\344\270\232/\345\215\216\344\270\272\346\211\213\346\234\272.html" "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\200\350\212\202\350\257\276\344\275\234\344\270\232/\345\215\216\344\270\272\346\211\213\346\234\272.html" new file mode 100644 index 00000000..e69de29b 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\200\350\212\202\350\257\276\344\275\234\344\270\232/\346\230\276\347\244\272\345\261\217.html" "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\200\350\212\202\350\257\276\344\275\234\344\270\232/\346\230\276\347\244\272\345\261\217.html" new file mode 100644 index 00000000..e69de29b 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\200\350\212\202\350\257\276\344\275\234\344\270\232/\346\270\270\346\210\217\346\234\272.html" "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\200\350\212\202\350\257\276\344\275\234\344\270\232/\346\270\270\346\210\217\346\234\272.html" new file mode 100644 index 00000000..e69de29b 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\200\350\212\202\350\257\276\344\275\234\344\270\232/\347\254\224\350\256\260\346\234\254.html" "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\200\350\212\202\350\257\276\344\275\234\344\270\232/\347\254\224\350\256\260\346\234\254.html" new file mode 100644 index 00000000..e69de29b 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\200\350\212\202\350\257\276\344\275\234\344\270\232/\350\213\271\346\236\234\346\211\213\346\234\272.html" "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\200\350\212\202\350\257\276\344\275\234\344\270\232/\350\213\271\346\236\234\346\211\213\346\234\272.html" new file mode 100644 index 00000000..e69de29b 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\200\350\212\202\350\257\276\344\275\234\344\270\232/\351\201\277\345\255\225\345\245\227.html" "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\200\350\212\202\350\257\276\344\275\234\344\270\232/\351\201\277\345\255\225\345\245\227.html" new file mode 100644 index 00000000..e69de29b 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\200\350\212\202\350\257\276\344\275\234\344\270\232/\351\274\240\346\240\207.html" "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\200\350\212\202\350\257\276\344\275\234\344\270\232/\351\274\240\346\240\207.html" new file mode 100644 index 00000000..e69de29b -- Gitee From 325e93e78275c317a7aab0c9cd11669a9456ad36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E8=99=9A=E5=B9=B3?= <8437069+zhang-xuping@user.noreply.gitee.com> Date: Tue, 23 Feb 2021 23:15:40 +0800 Subject: [PATCH 2/4] init commit --- .../test.py" | 34 +- ...\344\270\272\346\211\213\346\234\272.html" | 0 ...\346\230\276\347\244\272\345\261\217.html" | 7795 +++++++++++++++++ ...\346\270\270\346\210\217\346\234\272.html" | 7736 ++++++++++++++++ ...\347\254\224\350\256\260\346\234\254.html" | 7726 ++++++++++++++++ ...\346\236\234\346\211\213\346\234\272.html" | 0 ...\351\201\277\345\255\225\345\245\227.html" | 0 .../\351\274\240\346\240\207.html" | 6557 ++++++++++++++ 8 files changed, 29832 insertions(+), 16 deletions(-) delete mode 100644 "\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\200\350\212\202\350\257\276\344\275\234\344\270\232/\345\215\216\344\270\272\346\211\213\346\234\272.html" delete mode 100644 "\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\200\350\212\202\350\257\276\344\275\234\344\270\232/\350\213\271\346\236\234\346\211\213\346\234\272.html" delete mode 100644 "\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\200\350\212\202\350\257\276\344\275\234\344\270\232/\351\201\277\345\255\225\345\245\227.html" 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\200\350\212\202\350\257\276\344\275\234\344\270\232/test.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\200\350\212\202\350\257\276\344\275\234\344\270\232/test.py" index 15cb5f59..40be1c11 100644 --- "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\200\350\212\202\350\257\276\344\275\234\344\270\232/test.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\200\350\212\202\350\257\276\344\275\234\344\270\232/test.py" @@ -1,4 +1,4 @@ -第一问:搜索页面请求 +# 第一问:搜索页面请求 import requests from urllib.parse import quote, unquote @@ -12,17 +12,17 @@ def request_jd(keyword): "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36" } response = requests. get(url=url, params=params, headers=headers) - + f.write(response.text) + f.close() print(response.text) if __name__ == "__main__": - request_jd("鼠标") - request_jd("显示屏") - request_jd("游戏机") - request_jd("笔记本") - request_jd("华为手机") - request_jd("苹果手机") - request_jd("避孕套") + i = ["鼠标", "显示屏", "游戏机", "笔记本"] + for a in range(len(i)): + b = i[a] + request_jd(b) + + 第二问:详细页面请求 @@ -32,14 +32,16 @@ import string f = open("detailed information.html", "w", encoding="utf-8") url = 'https://item.jd.com/1337248.html' response = urlopen(quote(url,safe=string.printable)) +f.write(response.text) +f.close() print(response) - - - - - - - +# +# +# +# +# +# +# 第三问:json练习 import json test_dict = { 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\200\350\212\202\350\257\276\344\275\234\344\270\232/\345\215\216\344\270\272\346\211\213\346\234\272.html" "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\200\350\212\202\350\257\276\344\275\234\344\270\232/\345\215\216\344\270\272\346\211\213\346\234\272.html" deleted file mode 100644 index e69de29b..00000000 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\200\350\212\202\350\257\276\344\275\234\344\270\232/\346\230\276\347\244\272\345\261\217.html" "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\200\350\212\202\350\257\276\344\275\234\344\270\232/\346\230\276\347\244\272\345\261\217.html" index e69de29b..300de360 100644 --- "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\200\350\212\202\350\257\276\344\275\234\344\270\232/\346\230\276\347\244\272\345\261\217.html" +++ "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\200\350\212\202\350\257\276\344\275\234\344\270\232/\346\230\276\347\244\272\345\261\217.html" @@ -0,0 +1,7795 @@ + +
+ + + + + + + + + + + + + + + + + + +