webbrowser-control

The WebBrowser control won't work with Proxies from a text file

房东的猫 提交于 2021-02-04 08:07:32
问题 I'm not that great with visual basic so sorry about that, but I have a basic understanding of java, and a few other programming languages so I'm not completely new. I want to make a program that connects to a website with a proxy loaded from a text file, but when I debug it, it gives me a bunch of different error messages, like: HTTP Error 503. The service is unavailable The webpage cannot be found etc. Here is my code for loading in the proxies into a listbox: Private Sub Button1_Click(ByVal

Close Application after WebBrowser print

前提是你 提交于 2021-01-29 04:10:02
问题 I tried to print formatted HTML using WebBrowser class. After the print, I want to close the application. If I tried to use close the application the printing is not working. I tried using the timer also nothing works. Please find the code below. static void Main(string[] args) { var b = new Program(); string appPath = System.IO.Path.GetDirectoryName(Application.ExecutablePath); b.runBrowserThread("file://" + appPath + "/receipt.html"); } private void runBrowserThread(string url) { var th =

WebBrowser, wait until finished printing

一个人想着一个人 提交于 2021-01-29 03:11:49
问题 I'm working with the WebBrowser control in C#. I use the WebBrowser in a form and I insert some HTML and CSS into this WebBrowser. It works well. I would like to print from this WebBrowser directly and check the print status. If it finishes, the application will close automatically. I searched for something like: WebBrowser.Print() wait until complete. .NET. It works, but when I'm in debug mode, my code never goes through the event "DocumentCompleted". So I tried printing in form's Shown

C# Facing problem to read ajax data using web browser control

我是研究僧i 提交于 2021-01-28 23:10:22
问题 This is a web site https://www.wsj.com/news/types/newsplus whose data is getting loaded by ajax at runtime. i have to read all article title text. from morning i tried lots of code but still no code worked because data is getting load by ajax. This is my code which i tried. HtmlDocument hd = GetHtmlAjax(new Uri("https://www.wsj.com/news/types/newsplus"), 300, true); ParseData(hd); HtmlElementCollection main_element = hd.GetElementsByTagName("h3"); if (main_element != null) { foreach

Python: Change url of web browser using webbrowser-control

不羁的心 提交于 2021-01-28 20:03:53
问题 Ok, I know that if you want to open a particular url using pyton you would run: import webbrowser webbrowser.open("buinvent.com") But what if you want to change it to a different url in the web browser without opening a new window or a new tab in the web browser. Is there a way to do that? 回答1: import webbrowser webbrowser.open('google.com', new = 0) And the docs says: If new is 0, the url is opened in the same browser window if possible. If new is 1, a new browser window is opened if

IHTMLDocument2 and Internet Explorer 11 changes on Windows 7

纵然是瞬间 提交于 2021-01-28 00:15:57
问题 I use TWebBrowser to have HTML editor in my application and of course it depends on version of Internet Explorer installed. I noticed after installation of the brand new Internet Explorer 11 on Windows 7 that my editor has changed. Paragraphs no longer seem to have same HTML code. HTML generated before when I pressed enter key: <P> </P> HTML generated now: <P><BR></P> This gives me additional line in my editor which doesn't look right. <P> itself has a new line, <BR> is completely useless

Webbrowser control onclick event

孤街醉人 提交于 2021-01-27 23:28:06
问题 I have a code that clicks an html element but it doesn't fire its java script code, in VBA I used to call "initEvent" in order to invoke a java script event. I have searched the web and haven't found a suitable solution. There's a working solution, but it's not quite useful in most cases, placing a java script code in the url and navigating to it, however there's a need for the location of the html element which is a problem sometimes. The code I use in order to do a click in the html element

How to insert a new row into a table in a WebBrowser control

喜夏-厌秋 提交于 2021-01-05 07:27:45
问题 I have added the following content to a WebBrowser control on form Load : private void Form1_Load(object sender, EventArgs e) { addFirst(); } private void addfirst() { string html = "<!DOCTYPE html>"; html += "<html><head><title>NewPage</title>"; html += "<style>"; html += "body {font-family: Verdana, Tahoma, sans-serif; font-size: 12px;} .vtop {vertical-align: top;} table th:nth-child(1) {width: 20%;}"; html += "table th:nth-child(2) {width: 30%;} table th:nth-child(3) {width: 50%;}"; html +

How to insert a new row into a table in a WebBrowser control

人走茶凉 提交于 2021-01-05 07:26:10
问题 I have added the following content to a WebBrowser control on form Load : private void Form1_Load(object sender, EventArgs e) { addFirst(); } private void addfirst() { string html = "<!DOCTYPE html>"; html += "<html><head><title>NewPage</title>"; html += "<style>"; html += "body {font-family: Verdana, Tahoma, sans-serif; font-size: 12px;} .vtop {vertical-align: top;} table th:nth-child(1) {width: 20%;}"; html += "table th:nth-child(2) {width: 30%;} table th:nth-child(3) {width: 50%;}"; html +

How to fill a WebForm and click the submit Button with a WebBrowser control?

限于喜欢 提交于 2020-12-13 03:21:21
问题 How can I click this SUBMIT button using a WebBrowser control? I've tried with: For Each divSect As HtmlElement In WebBrowser1.Document.GetElementsByTagName("button") If divSect.OuterHtml.Contains("Accedi") Then For Each elem As HtmlElement In divSect.Children If elem.GetAttribute("type") = "button" Then elem.InvokeMember("click") End If Next End If Next but it doesn't return anything. 回答1: Here's a sample procedure to perform a WebForm LogIn using a WebBrowser control. ► Note : I suggest to