How can i grab text from a web browser? - vb.net

I need to go into my implemented web browser and take text from lets say a label on the page. For example on this page it says "Related Questions" I need to copy that text and paste it into my from. Thanks in advance :)

Apparently you're using a WebBrowser element to show a homepage on your form. Use the following short code snippet to get the source code of the website you're viewing (the source code will be written into the TextBox1 in that example). Now you'll just have to filter out whatever you need (in your case it's a certain text which is hopefully between two HTML elements for ease). You might need RegEx for that (in case you're looking for an easy solution).
TextBox1.Text = WebBrowser1.DocumentText

Related

how to keep second pdf page hidden until button is selected on first page

I've created a pdf user form with the option to only put 10 line items, however, if the user requires to insert additional item codes, I've created a second form for just that. I would like to know if it is possible to keep the second document hidden until the user clicks a button to activate the second sheet - making it accessible to insert addition item codes if needed. Thank you for your help in this matter.
I'm not sure I understand your intent completely from your question. If you you wish to display your PDF forms as separate pages, it's as simple as this HTML:
<button onclick="location.href='SecondPage.html';">Show More</button>
Where "SecondPage.html" becomes instead the URL of your second PDF.
If you wish instead to display the two PDFs on the same web page simultaneously, we'd probably need to see some markup of what you've tried so far. You generally get better answers on StackOverflow if you can present examples of what you've tried so far.
But your general approach would probably be a simple one: Put both PDFs into DIVS with styles applied so that the first DIV is visible and the second DIV is hidden. Then, the onclick for the button I've written above, instead of displaying a page, would simply call a javascript function that alters the style for the second DIV, changing its style from "hidden" to "block".

clicking button on HTML jscript using vba

I have been trying to click a button on webpage using VBA but with no luck, I could see some JavaScript is used which I am not sure how to use this.
below is the code which I am using also snip of html code is below
ie.document.getelementbytagname(""nobr").click
below is the html code
Insert Row
Please help
KR
Manoj Sahoo
Depending on which element you might need something like
ie.document.getElementsByTagName("nobr")(0).click
Note the s making it plural as it returns a collection of nobr tags. You then access items by index e.g. 0.
Without the URL, or more HTML to go on, it is impossible to tell if you are selecting the right item to click.

.Click on an a tag does not work

I'm trying to navigate into a web page automatically with VBA to scrape some values from different product ID's. The problem is that when I get to this intermediate page: http://www.siicex-caaarem.org.mx/Bases/TIGIE2007.nsf/4caa80bd19d9258006256b050078593c/$searchForm?SearchView (search for code 11081201, for example), where I'm supposed to click on the only "a" tag there, the program keeps crashing with
Object variable or With block variable not set
on the line that should click on the element:
objIE.document.getElementsByTagName("a")(0).Click
I have been using similar working lines of code for the same purpose on different pages (ussualy with a for each loop, which doesnt work here either), so I'm unsure why it doesn't work here. I appreciate your help with this.
The solution for this was adding DoEvents before the line that clicks on the element.

pass value to a web browser and print it in a particular textbox

I have a win-form application that generates passwords that I would like to send directly over to a web page textbox like input as apart of a new user sign up. I found a similair question. (Fill Form C# & Post Error) But I dont think I am after the same goal. Is it possible to do this without using a macro or manually copy n pasting? The above post is in C# however I will ever using vb. If there is a answer on here please link, but I have gone through the forum.

Change text in masterpage based on the language selected

In my master page along with the search box I have label "Search". Now it is hard coded and
is working fine. But when I change language the text should change to "Rechercher". This should happen in master-page, how can I achieve this. There few mote other texts which also needs to be changed based on the language change.
Thanks in advance for the help
I would recommend using an EncodedLiteral control with an out of the box Resource string. If your master page was based on an out of the box master page like v4.master, you should be able to see many examples of this control in use.
To include a language aware label for search, I might use the following:
<SharePoint:EncodedLiteral runat="server"
text="<%$Resources:wss,mobile_navigation_search_text%>"
EncodeMethod="HtmlEncode"/>