Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

How to get xml page source if url is given

by ashok13123 (Novice)
on May 29, 2009 at 04:25 UTC ( [id://766803]=perlquestion: print w/replies, xml ) Need Help??

ashok13123 has asked for the wisdom of the Perl Monks concerning the following question:

I am having a url say http://www.perlmonks.org.... I want to get the page source(xml) of this one..How can I get that from a linux machine????????

Replies are listed 'Best First'.
Re: How to get xml page source if url is given
by ikegami (Patriarch) on May 29, 2009 at 04:31 UTC

    The page at http://www.perlmonks.org/ is not XML (it's HTML).

    Pages can be fetched using LWP::UserAgent

      The OP probably meant the xml-representation of perlmonks nodes. In that case he should add displaytype=xml to the URI he fetches.


      holli

      When you're up to your ass in alligators, it's difficult to remember that your original purpose was to drain the swamp.
Re: How to get xml page source if url is given
by ambrus (Abbot) on May 29, 2009 at 06:00 UTC
Re: How to get xml page source if url is given
by ajt (Prior) on May 29, 2009 at 08:16 UTC

    You can use any number of HTTP clients to get a URI, wget, curl, GET (from LWP) from the Linux command line. Within a Perl program, as others have said there are also a range of HTTP clients, LWP being the most obvious.

    However your question suggests you want the XML source of a page before it is turned into a (X)HTML page. That is more complex as the transformation usually takes place at the server side and you may or may not be able to gain access to that depending on how the server is configured.


    --
    ajt

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (4)
As of 2024-03-29 12:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found