Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

How to get xml page source if url is given

by ashok13123 (Novice)
on May 29, 2009 at 04:25 UTC ( #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????????
  • Comment on How to get xml page source if url is given

Replies are listed 'Best First'.
Re: How to get xml page source if url is given
by ikegami (Pope) 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
Node Status?
node history
Node Type: perlquestion [id://766803]
Approved by ikegami
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (1)
As of 2018-07-18 23:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (398 votes). Check out past polls.

    Notices?