Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Extracting stylesheet links or url from HTML Page

by ww (Archbishop)
on Jun 23, 2010 at 22:39 UTC ( [id://846192]=note: print w/replies, xml ) Need Help??


in reply to Extracting stylesheet links or url from HTML Page

You do have an answer (above) which may serve... but for best results, post the code you've written; the error messages it produces (or describe the failure with great specificity).

And, while it's NOT customarily advisable, this is one that could be tackled with a simple regex: search from the start of the .html file to </head> for rel="stylesheet" or even for .css and, when found, use a capturing regex to get the (relative) link. Then, of course, for that to be much use, you'll need to concat the site address...

And just BTW, that's not guaranteed to produce a valid link to the stylesheet (identifying the reason is left as an exercise for the pupil). OTOH, since I'm hard pressed to find a practical use for your desired code, (unless you collect style sheets the way NodeReaper collects toe tags) perhaps this is homework... which should also be disclosed when posting here.

Update: s/and way/the way/ in last para.

Replies are listed 'Best First'.
Re^2: Extracting stylesheet links or url from HTML Page
by kalyanrajsista (Scribe) on Jun 24, 2010 at 09:03 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://846192]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (9)
As of 2024-04-23 09:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found