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)