提交 05e8c614 编写于 作者: 梦想橡皮擦's avatar 梦想橡皮擦 💬

selenium

上级 d7fe9a50
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="ac8b93cf-2a21-4220-8483-233f114cf9e6" name="Default Changelist" comment="" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES">
<list>
<option value="Python Script" />
</list>
</option>
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="ProjectId" id="1zRS2YQED6SBcnWYluuvxmNQ6cx" />
<component name="ProjectLevelVcsManager">
<ConfirmationsSetting value="1" id="Add" />
</component>
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
</component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="ac8b93cf-2a21-4220-8483-233f114cf9e6" name="Default Changelist" comment="" />
<created>1634109200298</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1634109200298</updated>
</task>
<servers />
</component>
<component name="WindowStateProjectService">
<state x="539" y="0" width="840" height="1034" key="search.everywhere.popup" timestamp="1634114023929">
<screen x="0" y="0" width="1920" height="1032" />
</state>
<state x="539" y="0" width="840" height="1034" key="search.everywhere.popup/1920.58.1440.852/0.0.1920.1032@0.0.1920.1032" timestamp="1634114023929" />
</component>
</project>
\ No newline at end of file
......@@ -8,4 +8,5 @@
- [三元表达式篇,python 入门教程之每日 5 or 6 道题 | Python技能树征题](https://dream.blog.csdn.net/article/details/120498213)
- [断言、with-as 篇,python 入门教程之每日 5 or 6 道题 | Python 技能树题库](https://dream.blog.csdn.net/article/details/120553317)
- [常用标准库 random,python 入门教程之每日 5 or 6 道题 | Python 技能树题库](https://dream.blog.csdn.net/article/details/120743071)
- [python 爬虫 selenium 框架,入门就看这 5 道题 | Python技能树征题](https://dream.blog.csdn.net/article/details/120744753)
"""
题干(问题描述):
使用 selenium 框架,实现捕获浏览器弹窗代码,正确的是?
"""
from selenium import webdriver
import time
driver = webdriver.Chrome()
driver.get("https://www.csdn.net")
time.sleep(2)
js = "alert('提示弹窗')"
driver.execute_script(js)
alt = driver.switch_to.alert
print(alt.text)
"""
题干(问题描述):
在 Selenium 中如何打开无头谷歌浏览器
"""
from selenium import webdriver
opt = webdriver.ChromeOptions()
opt.headless = True
driver = webdriver.Chrome(options=opt)
driver.get("http://www.csdn.net")
"""
题干(问题描述):
获取 Selenium 打开的所有窗口句柄,并切换浏览器到第一个选项卡。
"""
from selenium import webdriver
driver = webdriver.Chrome()
driver.get("https://www.csdn.net")
all_handles = driver.window_handles
print(all_handles)
driver.switch_to.window(all_handles[0])
"""
题干(问题描述):
selenium 可以隐式设置网页等待时间,下述那一段代码可以实现隐式等待 10 秒。
"""
from selenium import webdriver
driver = webdriver.Chrome()
driver.implicitly_wait(10)
driver.get("http://www.csdn.net")
"""
题干(问题描述):
Selenium 在执行 Javascript 代码时,可以向Javascript 代码中传递参数,下述写法正确的是。
"""
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
opt = Options()
driver = webdriver.Chrome()
driver.get("http://www.csdn.net")
js = "document.title = arguments[0]"
ret = driver.execute_script(js, ("我的CSDN",))
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册