Thread
:
HTTP Automation?
View Single Post
Patola
2010-06-22 , 21:06
Posts: 267 | Thanked: 183 times | Joined on Jan 2010 @ Campinas, SP, Brazil
#
4
Originally Posted by
Jaso333
But as for actually accessing the elements on a web page? Would I read it using an XML parser?
You get simply a big chunk of data with the entire result of the HTTP request. I usually load it to a variable. Then you can process it any way you want, even grep it for strings. Note that if the HTML has references to other items such as images you'll have to load them by yourself.
Curl does process POST's and GET's very well.
If you use perl with WWW::Curl, I suggest you use HTML::Parser and/or HTML::TokeParser. It's easy to use to interpret the HTML file. For python it seems there is python-html5lib.
Note also that you have the option of using WWW::Mechanize in perl and python-mehanize, but I have no experience with this.
__________________
My nickname on freenode is ptl, that is, the consonants of my nickname here. Kind of a long story.
Quote & Reply
|
Patola
View Public Profile
Send a private message to Patola
Find all posts by Patola