Wednesday 15 July 2015

vb.net - Visual Basic & HTML Agility Pack -


I'm trying to pull the title of the page from Yahoo!

I will ask that the user creates a URL for the symbol:

When I load a local page locally, this work is very good ...

Here's my code:

  Private sub button handles 1_Click (as the sender object, and EventArgs) button 1. String as a dim mark, new HTML document as HTMLDC symbol = Textbox 3. Text HTML.com Load ("http://finance.yahoo.com/ q? S = plug") Dim item = htmldoc.DocumentNode.SelectNodes ("// head / title"). Select (Keynote) new keypad (string, strings) (node.intertext, node.intertext) for each item as KeyValuePair (string, string of) items in the console. WrightLine (item.Key) console Wrightite (item.Value) Next End Sub   

How do anyone know I could do this work? I want to finally pull the stock prices ...

Whatever I'm trying to do, I am also down to learning an easy way to do. Rather than using unexpected etc ... just a few things that I finally found to work on any other SO question

Thank you.

When dragging the web URL, you should use the HtmlWeb The square should be used. The HtmlDocument.Load method can only be read from local files (or stream). You are probably seeing an error on the lines of "Can not read from url" or "url not supported"

  dim url = "http://finance.yahoo.com/q? S = plug" dim web = new HTML web dicc = web Load (URL) dim titan.dode = dock Dock DocumentNode The Select Sending Node ("/ html / head / title") is a title if the string is not the title in the form of a slow heading, then nothing like the title = title node. Entertext end if    

No comments:

Post a Comment