Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default programmatically retrieve links from web page

Hi there

I am using the Microsoft XML v6.0 library to retrieve a web page from the
Internet, as follows:

Dim oHttp As Object
Set oHttp = CreateObject("MSXML2.XMLHTTP")
oHttp.Open "GET", "http://www.microsoft.com/default.aspx", False
oHttp.Send
content = oHttp.responseText

Once downloaded, I want to search through the page for all URLs that link
through to other web pages (ie. contained within <a </a tags). The problem
is that, given the huge diversity of formats for links (relative and
absolute references, url-encoding, etc.), I'm struggling to write out all
the possibilities in code.

Is there an easier way to retrieve the contents of a specific element in a
web page, or even better, to scroll through collections of elements? I've
tried XML proper (MSXML2.DOMDocument40) but this doesn't seem to work with
HTML pages' loose structure.

Best regards
Loane



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default programmatically retrieve links from web page

Hi Loane,

Different approach, but see the following:

http://www.dicks-blog.com/archives/2...rnet-explorer/

Regards,
Nate Oliver

Loane Sharp wrote:
Once downloaded, I want to search through the page for all URLs that link
through to other web pages (ie. contained within <a </a tags). The problem
is that, given the huge diversity of formats for links (relative and
absolute references, url-encoding, etc.), I'm struggling to write out all
the possibilities in code.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default programmatically retrieve links from web page

Hi Nate
What a simple, elegant solution. Thanks a stack
Best regards
Loane
"Nate Oliver" wrote in message
oups.com...
Hi Loane,

Different approach, but see the following:

http://www.dicks-blog.com/archives/2...rnet-explorer/

Regards,
Nate Oliver

Loane Sharp wrote:
Once downloaded, I want to search through the page for all URLs that link
through to other web pages (ie. contained within <a </a tags). The
problem
is that, given the huge diversity of formats for links (relative and
absolute references, url-encoding, etc.), I'm struggling to write out all
the possibilities in code.




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to: links on the same page Erich Koch New Users to Excel 6 September 27th 08 04:32 AM
How do I retrieve a page number in Excel? rambo1989 Excel Worksheet Functions 1 December 6th 07 01:10 PM
Move page breaks programmatically... Theresa Smallwood Excel Programming 6 July 13th 05 03:12 PM
How do I disable links on the page? Kenjiro Yagi Excel Worksheet Functions 1 November 19th 04 06:53 PM
How to Programmatically Insert a Page Break Every Nth Row in a Range KK[_3_] Excel Programming 0 November 21st 03 12:49 AM


All times are GMT +1. The time now is 07:12 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"