Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re: Extract data from website and transfer it to Outlook

by Anonymous Monk
on Apr 29, 2006 at 03:49 UTC ( #546459=note: print w/replies, xml ) Need Help??

in reply to Extract data from website and transfer it to Outlook

I have done a couple of web sites like this. I did not use WWW::Mechanize, but instead LWP::Simple or LWP::UserAgent, and HTML::TokeParser; HTML::LinkExtractor; no one showed me how to do this, I just did some reading and tried it.

I also have no problem breaking it up into steps. As in, get some data in a format, then use my trusty text editor with Grep expressions to reform the data lines, then back to a perl script to put it somewhere.

In several cases, I looked at the URL that gets me a page of data, then made a list of values to substitute into that URL, then ran a perl script to do it and catch the result. e.g.
then looped with values 1 through 99 inserted in that line
If there is a nested link(s) I want to get, I might write a loop that uses the simple mode of LinkExtractor, iterating from one HREF to the next, and saving the results in seqentially named text files.

Then I run through the text files, open each one, and write a simple state machine loop that has a bunch of hard coded knowledge of the format of the page to look for and extract the data fields. Not generalized, not pretty, but works for the task. I write out each of the values in say a tab-delimitted format I have defined.

Lastly, I read in the tab delimited file into whatever target DB, like Outlook I suppose. THough I have not gone there :-)

  • Comment on Re: Extract data from website and transfer it to Outlook

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2019-02-16 21:15 GMT
Find Nodes?
    Voting Booth?
    I use postfix dereferencing ...

    Results (95 votes). Check out past polls.