通过C#控制网页浏览

编程入门 行业动态 更新时间:2024-10-23 19:24:23
本文介绍了通过C#控制网页浏览的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

有一个部分具有多个信息的基础(单击按钮后出现每个部分)。我想要一个加载html代码,获取所需信息,单击Next按钮并在加载所有信息时移动到下一部分的程序。

There is a base with several information partly(each part appears after clicking a button). I want a program which loads the html code, takes the needed information,clicks the Next button and moves to the next part while all information is loaded.

HttpWebRequest req; HttpWebResponse resp; StreamReader sr; string content; req = (HttpWebRequest)WebRequest.Create("testkrok.ua/"); resp = (HttpWebResponse)req.GetResponse(); sr = new StreamReader(resp.GetResponseStream(), Encoding.GetEncoding("windows-1251")); content = sr.ReadToEnd(); sr.Close();

这是我获取HTML代码的方式,但我不知道如何点击按钮(HTML代码中的按钮没有名称标签)以及如何获取代码下一页在此先感谢

This is how I gain HTML code, but I do not know how to ckick the button(the button in HTML code does not have name tag) and how get the code of next page. Thanks in advance

推荐答案

你好Soroush Saadatfar, 如果这完全代码回来了,那就多了难以实现,如果您在windows窗体应用程序中开发,我们可以通过使用webbrowser congtrol实现,通过注入JavaScript来单击下一个按钮,我们可以收集DocumentComplete事件上的数据, 希望这会有效 谢谢 Hello Soroush Saadatfar, If this is totally code back, it is much difficult to achieve, if your developing in windows form application,we can achieve by using webbrowser congtrol, by injecting JavaScript to click the next button, and we can collect the data on DocumentComplete Event, Hope this will works Thanks

更多推荐

通过C#控制网页浏览

本文发布于:2023-10-26 12:00:11,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1530073.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:网页浏览

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!