![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
weixin_45649241
这个作者很懒,什么都没留下…
展开
-
Selenium中Switch_to操作
Selenium中Switch_to操作 Switch_to.windows 通常会需要打开多个浏览器界面,如果不使用switch_to.window,程序会每次还去程序打开的最初始的那个界面寻找元素,这样就导致新界面中的元素找不到。 handles = driver.window_handles #获取当前浏览器的所有窗口句柄 driver.switch_to.window(handles[-1]) #切换到最新打开的窗口 driver.switch_to.window(hand原创 2020-07-20 13:55:18 · 1167 阅读 · 0 评论 -
使用Selenium获取Cookie配合requests进行操作
#使用Selenium获取Cookie配合requests进行操作 import requests from selenium import webdriver driver = webdriver.PhantomJS() driver.get('page_with_download_link') download_link = driver.find_element_by_id('download_link') session = requests.Session() cookies = driver.原创 2020-07-20 09:31:19 · 1475 阅读 · 0 评论