简体   繁体   English

C#:从网站读取HTML

[英]C#: Reading HTML from a website

I'm trying to read a website ( https://www.megaplextheatres.com/geneva ). 我正在尝试阅读一个网站( https://www.megaplextheatres.com/geneva )。 I want to read the website so that I can get a notification when it updates. 我想阅读该网站,以便在更新时得到通知。 I'm just trying to get good seats at the movies haha :) 我只是想在电影里找到好座位哈哈:)

I've started reading with a webclient and an httpwebrequest. 我已经开始使用webclient和httpwebrequest进行阅读。 When I read the data, I don't get ALL the data. 当我读取数据时,我不会获得所有数据。 I need to get the "buttons" that show the dates of the movies. 我需要获取显示电影日期的“按钮”。

Here's what I have so far: 这是我到目前为止的内容:

                HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url);
            HttpWebResponse response = (HttpWebResponse)request.GetResponse();
            StreamReader sr = new StreamReader(response.GetResponseStream());
            string html = sr.ReadToEnd();
            sr.Close();
            response.Close();

            Console.WriteLine(html);

as per suggested by @mohitshrivastava 按照@mohitshrivastava的建议

WebElement td_appname = driver.findElement.ByLinkText("MindMeister - 251-500 Pupil License");
WebElement td_appdescription = td_appname.findElement.Byxpath("./../td[2]");
String appdescription = td_appdescription.getText();

I hope it helps 希望对您有所帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM