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')