c# - C# Selenium 谷歌表
问题描述
我有代码:
driver.Navigate().GotoUlr("https://www.youtube.com/")
driver.FindElement(By.LinkText("abcd").Click();
我想在每次运行时导入许多链接以不更改代码,例如:
在谷歌表中:
colum 1:
youtube.com
google.com
bing.com
....about 100 lines
colum 2:
abcd
zxcv
mkopdsh
yuiofhxd
....about 100 lines
我怎么能用 C# 做到这一点。
解决方案
您最好的选择是将您的 excel 文件导入可执行文件的目录中。
然后您可以使用 HtmlAgilityPack 包将其打开并解析为 xml。另一种选择是使用 EPPlus 将其打开并解析为 excel 文件。
推荐阅读
- nlp - 大数据语料库的文本蕴涵
- rest - 使用骆驼休息 DSL 和 undertow 组件将休息服务部署到 Wildfly 虚拟主机
- javascript - 如何测试 Vue 组件的高度或宽度?
- jquery - 在 Google Chrome 中使用引导折叠时的奇怪行为
- python - docker compose服务中python版本的差异
- mysql - 用于计算连续年份的 SQL 代码 - 代码中的语法错误消息
- android - 安装 Android Studio 3.4 + Intel HAXM 7.5.2 后创建虚拟设备时出现问题
- pycharm - 我已经安装了 asyncpg 包,但我无法在我的代码中导入它
- javascript - 在对象数组中移动值的问题
- sql - 递归 CTE - 根据子值计算父值