The htmlextractlinks statement extracts the links from an HTML page.
Parameters
This statement has three parameters:page – HTML Page.
links – field or variable that will contain carriage return separated list of links.
option – Specifies what information will be extracted. The options are: url, title or both. If this parameter is omitted the default is url.
Description
This statement extracts the links from an HTML page. This example assumes the current database has a field named Page that contains HTML. If there are any links to URLs, those URLs will be put into the mylinks variable.
local mylinks
htmlextractlinks Page,mylinks
The output will be something like this:
http://www.apple.com/mac
http://www.apple.com/iphone
http://www.apple.com/ipad
Normally, only the URLs are extracted. If the third parameter is title, the titles will be extracted instead of the url. For example:
local mylinks
htmlextractlinks Page,mylinks,"title"
will output something like this:
Apple Macintosh
Apple iPhone
Apple iPad
If the third parameter is both, both the url and the titles will be returned, separated by the ¬ character. For example:
local mylinks
htmlextractlinks Page,mylinks,"both"
will output something like this:
http://www.apple.com/mac¬Apple Macintosh
http://www.apple.com/iphone¬Apple iPhone
http://www.apple.com/imac¬Apple iPad
See Also
History
Version | Status | Notes |
10.0 | No Change | Carried over from Panorama 6.0. |