.m3u8 파일을 찾을 때까지 기다릴 해결책을 찾았습니다. 브라우저로 보내지는 것을 볼 수 있도록 프록시로 fiddlecore를 사용하고 있습니다. 이렇게하면 모든 요청을 캡처 할 수 있으며 요청에 .m3u8이 포함되어 있으면 필요한 URL을 간단히 인쇄합니다. 그것은 fiddlecore가 인증을 필요로하므로 https에서 작동하지 않습니다 (수정하기 쉽습니다). 이것은 간단한 작업 코드입니다. "페이지가로드 될 때까지 기다립니다"에 대해
bool close = false;
// - Initialize fiddler for http proxy
Fiddler.FiddlerApplication.Startup(5000, true, false);
Fiddler.FiddlerApplication.BeforeResponse += delegate(Session s)
{
string path = s.fullUrl;
if (path.Contains("720p.m3u8"))
{
Console.WriteLine(path);
close = true;
}
};
// - Create a selenium proxy
var seleniumProxy = new OpenQA.Selenium.Proxy { HttpProxy = "localhost:5000"};
var profile = new FirefoxProfile();
profile.SetProxyPreferences(seleniumProxy);
// - Initialize selenium for browser automation
IWebDriver driver = new FirefoxDriver(profile);
driver.Navigate().GoToUrl("http://www.asite");
while (!close) { }
driver.Quit();
Fiddler.FiddlerApplication.Shutdown();
http://stackoverflow.com/questions/15122864/selenium-wait-until-document-is-ready – Muckeypuck
. 이것에는 두 가지 유형이 있습니다. Chrome의 경우 탭의 원이 회전하지 않으면 페이지가 '로드 중'입니까? 아니면 준비가되었다는 뜻입니까? –