Solved

Best Practice for reading HTML from website

Posted on 2011-09-17
5
295 Views
Last Modified: 2012-05-12
Experts,

In my attempt to teach myself more about programming, some of my ideas include creating a Windows based app for a website.
The application I'm going through now has most of the base data and calculations and just needs basic information from the target website (server based random numbers etc)
At the moment i'm going through Google Chrome developer tools to find the element and the getting that into VS2010
'Something like
Dim ele As HtmlElementCollection
ele = .GetElementsByTagName("TABLE")

Open in new window

and then through trial and error getting the Index of the table with the information that i'm wanting.

In short...is there an easier way to:
1. Download a Website Text only without using a browser (WebBrower object or IE)
2. Get the information I want without looking through ~50 elements
3. Send a URL request to the server (http://MyWebsite.net/viewpage.php?page_id=21&pid=155561&end=IVC) without the need to load the page and immediately cancel

Any information would be very helpful

-Bromy2004
0
Comment
Question by:bromy2004
  • 3
  • 2
5 Comments
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 36555691
I'm not sure I understand.  If you download from a URL, you will get the HTML page from the server.  There is nothing that will get you "Text only".  What you get is what you see in the "View Source" in your browser.
0
 
LVL 10

Author Comment

by:bromy2004
ID: 36555729
Thanks Dave, I thought there would be an option to not download the images.
Any tips for point 2 and 3?
0
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 36555868
The web page you download has links to the images in <img> tags but does not include them.  Browsers download them separately.  What you get is literally what you see in the "View Source", no more, no less.

Searching is normally done in a loop, going thru the available data until you find what you want.  I don't know of any other way to do it when you don't know where it is.

And I don't understand the third item.  I would let it load to make sure the process got finished on the server.
0
 
LVL 10

Author Closing Comment

by:bromy2004
ID: 36555923
Thank you
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 36555941
You're welcome.
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Someone recently asked me about how to display a progress indicator on a page while an iframe is loading. And I remember when I first came across this myself. It was a bit tricky to get my head around, but really, it's very simple. The most impor…
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question