【发布时间】:2022-01-02 05:24:15
【问题描述】:
关键是我希望能够将链接粘贴到文本框,单击按钮后,我希望加载此链接。我不知道该怎么做太多了
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
string url = textBox1;
ChromeDriver driver;
Thread th;
private void Form1_Load(object sender, EventArgs e)
{
ChromeOptions options = new ChromeOptions();
options.AddArguments("--disable-notifications");
driver = new ChromeDriver(options);
driver.Navigate().GoToUrl(url);
【问题讨论】:
-
你的按钮有事件处理程序吗?其次,从文本框中获取文本的方法是使用
Text属性:例如textBox1.Text。
标签: c# string selenium-webdriver url selenium-chromedriver