【发布时间】:2015-09-16 03:06:46
【问题描述】:
所以我想在 youtube 上获取以下链接中的所有链接:https://www.youtube.com/my_videos?o=U
这就是我在 c# win form selenium firefox 驱动程序中尝试过的
IList<string> all = new List<string>();
foreach (IWebElement element in driver.FindElements(By.ClassName("vm-video-list")))
{
all.Add( element.FindElement(By.TagName("a")).GetAttribute("href").ToString());
}
File.WriteAllLines("GrabbedLinks.txt", all);
所以没有显示错误,但它只抓取其中一个链接...而不是显示所有 30 个。
【问题讨论】:
标签: c# selenium selenium-webdriver youtube