473,408 Members | 1,683 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

JavaScript web scraping test cases?

I've put together a Python package for scraping / testing pages that
depend on embedded JavaScript code (without depending on IE, Mozilla
or Konqueror, and with the DOM etc. all implemented in pure Python --
mostly a hacked 4DOM, with some bits from pxdom; the JavaScript
interpreter I'm using ATM is spidermonkey). It's still missing a lot
and is pre-alpha, but it works, just barely.

Anyway, the point of this post is that I'm looking for pages to test
it on, so if you have a page that you'd like scraped (one that uses
JavaScript in some non-trivial way, of course! -- for dynamically
modifying forms, setting cookies, or whatever), mail me the details:
better that than some randomly-selected site from the Internet.
Obviously, it should be something that doesn't violate any terms &
conditions of use or otherwise cause people trouble, and preferably
that doesn't require any signup.
[In fact, TBH, my completely ad-hoc methodology with this is to write
some web scraping code, discover that the JavaScript breaks things,
often by depending on some nonstandard DOM feature, hack the DOM a
bit, etc. Hopefully I'll reach a point in understanding where I can
rewrite the DOM from scratch ('scratch' here being 4DOM), properly, to
match some approximation of 'HTML DOM as deployed'...]
John
Jul 18 '05 #1
7 4984
jj*@pobox.com (John J. Lee) writes:
[...]
Anyway, the point of this post is that I'm looking for pages to test
it on, so if you have a page that you'd like scraped (one that uses
JavaScript in some non-trivial way, of course! -- for dynamically
modifying forms, setting cookies, or whatever), mail me the details:
better that than some randomly-selected site from the Internet.
Obviously, it should be something that doesn't violate any terms &
conditions of use or otherwise cause people trouble, and preferably
that doesn't require any signup.

[...]

Nobody?

I'll get my coat. ;-)
John
Jul 18 '05 #2
On Fri, 22 Aug 2003, Skip Montanaro wrote:
>> Anyway, the point of this post is that I'm looking for pages to test
>> it on, so if you have a page that you'd like scraped (one that uses
>> JavaScript in some non-trivial way, of course! ...


John> Nobody?

Sorry, I couldn't think of anything off the top of my head. In my own pages

[...]

Oh, I'm sure I'll have no trouble finding test cases -- I just thought
that, rather than some random sites that are of no use to anyone, there is
bound to be somebody out there who actually wanted to scrape a particular
page in the past, and had not bothered previously thanks to the
inconvenience of having to read & reproduce the effect of the JS code
(particularly code that messes about with forms). It would be nice to be
doing something useful at the same time as writing tests!

Of course, I already have those sites that gave rise to the 'itch' to do
this in the first place, but I'm sure there's lots of the browser object
model that they don't exercise...
John

Jul 18 '05 #3
On Fri, 22 Aug 2003, Skip Montanaro wrote:
>> Anyway, the point of this post is that I'm looking for pages to test
>> it on, so if you have a page that you'd like scraped (one that uses
>> JavaScript in some non-trivial way, of course! ...


John> Nobody?

Sorry, I couldn't think of anything off the top of my head. In my own pages

[...]

Oh, I'm sure I'll have no trouble finding test cases -- I just thought
that, rather than some random sites that are of no use to anyone, there is
bound to be somebody out there who actually wanted to scrape a particular
page in the past, and had not bothered previously thanks to the
inconvenience of having to read & reproduce the effect of the JS code
(particularly code that messes about with forms). It would be nice to be
doing something useful at the same time as writing tests!

Of course, I already have those sites that gave rise to the 'itch' to do
this in the first place, but I'm sure there's lots of the browser object
model that they don't exercise...
John

Jul 18 '05 #4
Anyway, the point of this post is that I'm looking for pages to test
it on, so if you have a page that you'd like scraped (one that uses
JavaScript in some non-trivial way, of course! ...


John> Nobody?

Sorry, I couldn't think of anything off the top of my head. In my own pages
I've only ever used JS in trivial ways. Aside from a calendar on the Mojam
search results pages, I don't think JS is used on our sites at all. Still,
you're welcome to try it out on something like

http://www.mojam.com/concerts/search...lue=greg+brown

Skip

Jul 18 '05 #5
John ...

I'm not sure what types of applications
you're looking for, but I have some JavaScript plots
that might be interesting to test ...

http://fastq.com/~sckitching/JS/Circle_MH.htm

http://fastq.com/~sckitching/JS/DD_Circles.htm

http://fastq.com/~sckitching/JS/Parabola.htm

--
Cousin Stanley
Human Being
Phoenix, Arizona
Jul 18 '05 #6
"Cousin Stanley" <Co***********@hotmail.com> writes:
I'm not sure what types of applications
you're looking for,
The kind that people actually want to use <wink>.

As I said, there's no problem finding test cases, I just thought that
while I was about this, somebody might happen be reading who was
actually trying to scrape a JS page.

but I have some JavaScript plots
that might be interesting to test ...

http://fastq.com/~sckitching/JS/Circle_MH.htm

[...]

Konqueror 3.1 didn't show anything, Mozilla 1.4 printed some pretty
circles, then froze!
John
Jul 18 '05 #7
John ...

Although it's been a while since I tested these scripts
I thought I remembered testing successfully in both
Mozilla 0.95 and IE 5.1 at the time ...

I tested this morning using Moz 1.3.1 and 2 out of 3 failed,
but all 3 worked in IE 6 ...

The JS used in these scripts, although a bit hackish,
doesn't use any particular IE magic ...

I zipped up all 3 scripts for convenience,
if you want to look at the sources ...

http://fastq.com/~sckitching/JS/JS_Plots.zip

Differences in JS/DOM implementations from browser to browser
hurt my head and seem to be an endless source of problems
for web developers ...

--
Cousin Stanley
Human Being
Phoenix, Arizona
Jul 18 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: David Jones | last post by:
Hi, I'm interested in learning about web scraping/site scraping using Python. Does anybody know of some online resources or have any modules that are available to help out. O'Reilly published an...
16
by: Christopher Benson-Manica | last post by:
Can anyone tell me which browsers implement Javascript 1.3? Specifically, which browsers will handle the identity operator (===) correctly? I ask because jslint suggests using it, but I don't want...
9
by: WindAndWaves | last post by:
I have written a oneline Javascript and I want to make sure that it matches with best practice: <DIV ID=isw><image></DIV> <A HREF="#" OnClick="document.getElementById('isw').innerHTML = '<IMG...
136
by: Matt Kruse | last post by:
http://www.JavascriptToolbox.com/bestpractices/ I started writing this up as a guide for some people who were looking for general tips on how to do things the 'right way' with Javascript. Their...
2
by: Erwin Moller | last post by:
Hi group, I have this obscure problem that really needs to be fixed, but I am out of ideas. Because the original script is very big, I'll try to summarize its functionality. Setup: - many...
25
by: acemtp | last post by:
Hello, I would like to show you a new collaborative website for javascript programmer. It's quite hard to know if some specific code you wrote will work on all browsers, and if not, why it...
4
by: onetitfemme | last post by:
Say, people would like to log into their hotmail, yahoo and gmail accounts and "keep an eye" on some text/part of a site .. I think something like that should be out there, since not all sites...
3
by: bruce | last post by:
Hi... got a short test app that i'm playing with. the goal is to get data off the page in question. basically, i should be able to get a list of "tr" nodes, and then to iterate/parse them....
1
by: Elizabeth Barnwell | last post by:
A tool to learn advanced core javascript. This is an example of one person's material, but you can copy/create your own to learn if this method is helpful to you....
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.