From 07b9c5f5ff9c5b9562801e37e6dfde9d423f4404 Mon Sep 17 00:00:00 2001 From: JLUVicent <17390955615@163.com> Date: Wed, 15 Sep 2021 21:43:14 +0800 Subject: [PATCH] =?UTF-8?q?Phantomjs=E6=98=AF=E9=9A=90=E5=BD=A2=E6=B5=8F?= =?UTF-8?q?=E8=A7=88=E5=99=A8=E7=9B=AE=E5=89=8D=E5=B7=B2=E7=BB=8F=E5=81=9C?= =?UTF-8?q?=E6=9B=B4=EF=BC=8C=E4=B8=8D=E7=94=A8=E4=BB=96=E4=BA=86?= 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 "28_selenium_phantomjs\347\232\204\345\237\272\346\234\254\344\275\277\347\224\250.py" diff --git "a/28_selenium_phantomjs\347\232\204\345\237\272\346\234\254\344\275\277\347\224\250.py" "b/28_selenium_phantomjs\347\232\204\345\237\272\346\234\254\344\275\277\347\224\250.py" new file mode 100644 index 0000000..a6eff80 --- /dev/null +++ "b/28_selenium_phantomjs\347\232\204\345\237\272\346\234\254\344\275\277\347\224\250.py" @@ -0,0 +1,21 @@ + +import time +from selenium import webdriver + +path = 'phantomjs.exe' + +browser = webdriver.PhantomJS(path) + +url = 'https://www.baidu.com' + +browser.get(url) + +# 拍快照 +browser.save_screenshot('baidu.png') + +time.sleep(2) + +input = browser.find_element_by_id('kw') +input.send_keys('Vicent') +time.sleep(2) +browser.save_screenshot('Vicent.png')