![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Selenium
Selenium
Z0o1010
这个作者很懒,什么都没留下…
展开
-
使用selenium实现无可视化界面
from selenium import webdriver from time import sleep from selenium.webdriver.chrome.options import Options # 实现无可视化界面(固定写法) chrome_options = Options() chrome_options.add_argument("--headless") chrome_options.add_argument("--disable-gpu") bro = webdriver原创 2020-11-09 15:55:10 · 532 阅读 · 1 评论 -
使用selenium进行QQ空间模拟登录
from selenium import webdriver from time import sleep bro = webdriver.Chrome(executable_path="./chromedriver.exe") bro.get("https://qzone.qq.com/") bro.switch_to.frame("login_frame") a_tag = bro.find_element_by_id("switcher_plogin") a_tag.click() user原创 2020-11-09 15:19:40 · 1625 阅读 · 0 评论 -
使用selenium操作iframe中的标签
from selenium import webdriver from time import sleep from selenium.webdriver import ActionChains bro = webdriver.Chrome(executable_path="./chromedriver.exe") bro.get("https://www.runoob.com/try/try.php?filename=jqueryui-api-droppable") # 如果定位的标签存在于ifra原创 2020-11-09 15:13:25 · 191 阅读 · 0 评论 -
使用selenium对浏览器进行基本操作
from selenium import webdriver import time bro = webdriver.Chrome(executable_path="./chromedriver.exe") bro.get("https://www.taobao.com/") # 标签定位 search_input = bro.find_element_by_id("q") # 标签交互 search_input.send_keys("iphone") # 执行js程序 bro.execute_s原创 2020-11-09 15:01:25 · 123 阅读 · 0 评论 -
使用selenium获取网页动态数据初体验
from selenium import webdriver from lxml import etree import time # 将浏览器驱动程序放入此目录 # 实例化浏览器对象(传入浏览器驱动程序) bro = webdriver.Chrome(executable_path="./chromedriver.exe") # 让浏览器发起指定url对应请求 bro.get("http://scxk.nmpa.gov.cn:81/xk/") # 获取浏览器当前页面源码数据 page_text =原创 2020-11-09 14:48:30 · 166 阅读 · 0 评论