6 ms·
I haven't seen much discussion of a more ideal way to solve this problem (to say: as a one-off like the author was doing, not reusable software), so I thought I
by techtalsky 12y ago
I haven't seen much discussion of a more ideal way to solve this problem (to say: as a one-off like the author was doing, not reusable software), so I thought I'd just think about how I'd do something similar.
Luckily there are libraries that are great at interacting with a web page or multiple pages at the same time without needing to actually have a browser instance open. There's selenium and its various scripting environments, which are meant for browser testing but work just fine for many automation tasks:
http://www.seleniumhq.org/ http://www.seleniumhq.org/
And, newer, are headless technologies like phantom.js:
http://phantomjs.org/ http://phantomjs.org/
and Dalek.js:
http://dalekjs.com/ http://dalekjs.com/
This is SO much easier than using Javascript to find purple links on a page, and so much more reliable.
He could have looked up each link on DB1, then used the data to look up the DB2 information.
In any case, what he did saved him hours and hours of time and started him on a lifelong interest in programming.
Also, obligatory relevant XKCD's:
http://xkcd.com/1319/ http://xkcd.com/1319/ &
http://xkcd.com/1205/ http://xkcd.com/1205/