From 24aaafecf3e261a5adc04990e37e5d12a9f23964 Mon Sep 17 00:00:00 2001 From: JLUVicent <17390955615@163.com> Date: Wed, 15 Sep 2021 19:25:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A8=E6=80=81=E8=AE=BF=E9=97=AE=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E4=BC=9A=E8=87=AA=E5=8A=A8=E6=89=93=E5=BC=80=E6=B5=8F?= =?UTF-8?q?=E8=A7=88=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...72\346\234\254\344\275\277\347\224\250.py" | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 "24_selenium_selenium\345\237\272\346\234\254\344\275\277\347\224\250.py" diff --git "a/24_selenium_selenium\345\237\272\346\234\254\344\275\277\347\224\250.py" "b/24_selenium_selenium\345\237\272\346\234\254\344\275\277\347\224\250.py" new file mode 100644 index 0000000..82e6d5c --- /dev/null +++ "b/24_selenium_selenium\345\237\272\346\234\254\344\275\277\347\224\250.py" @@ -0,0 +1,21 @@ + +# (1)导入selenium +from selenium import webdriver + +# (2)创建浏览器操作对象 +path = 'chromedriver.exe' + +browser = webdriver.Chrome(path) + +# (3)访问网站 +# url='https://www.baidu.com' + +# browser.get(url) + +url = 'https://www.jd.com/' +browser.get(url) + +# page_source获取网页源码 +content = browser.page_source + +print(content)