I have a list of several hundred URL's, within one password protected account, and having the following format:

https://somesite.com/somescript.php?nameA
https://somesite.com/somescript.php?nameB
https://somesite.com/somescript.php?nameC
...

For each of those URL's, I would like to extract a string value from the corresponding webpage with such value always located between a specific prefix-string and a postfix-string, and creating a local CSV file with the data extracted from each URL:

nameA,valueA
nameB,valueB
nameC,valueC
...

Is there any simple way or script for doing this in Mac OS X?

I already tried the iMacros plugin for Firefox, but it seems it doesn't work, at least on Mac OS X. Maybe Automator, but I can't figure out how to do it...

link|improve this question
Where does one get valueA from? Is it also in the URL and did you forgot to mention it? Please note that this should be relatively to do with a text editor and a regular expression search & replace. I don't know about a browser plugin capable of doing this though. I suppose you have these URLs in a list that you can copy paste to a text editor? Or are they really separate and not copyable? Because then writing an userscript with GreaseMonkey might be necessary, or well, a macro plugin. – Tom Wijsman Jan 2 at 23:01
valueA is not on the URL, it's on the content page that URL leads to. Yes I have a list of the URLs and/or names, that's no issue, and only the last parameter (name) changes. A userscript in GreaseMonkey might be a good idea (thanks!), though I'm not familiar with that. Right now, I was considering a bash script using cURL [curl.haxx.se/] to extract content page and sed to parse the required values from the content. Main issues are handling web login through HTTPS and also all the regular expression madness. – user111780 Jan 3 at 1:57
As there are logins, you might me looking more towards a programming language and libraries capable of passing form data and cookies. And then screen-scrape all the data from the pages. I doubt if cURL supports login sessions... – Tom Wijsman Jan 3 at 2:26
feedback

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
or
required, but never shown

Browse other questions tagged or ask your own question.