Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2007-06

html link extractor

6 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Andrew Haines

Is there a unit somewhere that can extract links from html pages? I want to be able to recursively add pages to a chm archive.

Thanks,

Andrew Haines

L
Andrew Haines wrote
Is there a unit somewhere that can extract links from html pages? I want to be able to recursively add pages to a chm archive.

I created a program called GetLinks in a couple minutes: http://opensvn.csie.org/pspcgi/general-utilities/parser/html/demo/getlinks.pas

Latest html parser files in progress:
http://opensvn.csie.org/pspcgi/general-utilities/parser/html/

p.s. It is a little heavy handed to create and free two classes just to do a simple task like get some urls from a web page. Some day I'll make a simpler even lighter version of that parser for quick and dirty usage, but still keep the old one maybe. But whatever works, works!

Andrew Haines
to L
Show quoted text 10 lines
Andrew Haines wrote: > Is there a unit somewhere that can extract links from html pages? I want > to be able to recursively add pages to a chm archive. I created a program called GetLinks in a couple minutes: http://opensvn.csie.org/pspcgi/general-utilities/parser/html/demo/getlinks.pas Latest html parser files in progress: http://opensvn.csie.org/pspcgi/general-utilities/parser/html/

This is great stuff thanks :)

I've just made a chm sitemap reader using your units. Next a writer.

Regards,

Andrew

L
> Is there a unit somewhere that can extract links from html pages? I want > to be able to recursively add pages to a chm archive. I created a program called GetLinks in a couple minutes:

Updated the files and changed the htmlutil functions a bit.

Also, created a recursive example that uses Synapse.. and grabs web links *infinitely* until it finds no more links (using nested pascal function for the recursion, Torvalds hates those).

The recursive demo probably won't work with file:// style links since it invokes Synapse, and only simple http relative paths work as is. (not sure if CHM files use file:// style links, guessing).

Latest download includes recursive extractor and getlinks demo: http://z505.com/download/pascal/html/fast-html-parser-jul-02-2007.zip http://sourceforge.net/project/showfiles.php?group_id=145841&package_id=212708&release_id=520417