[REBOL] Re: Downloading patents?
From: arolls:bigpond:au at: 1-Sep-2001 17:31
Your example has 7 pages, right?
If you look in the source to your
example link below, you see that there
are two frames. The first one is the
navigation bar, which you are clicking
the right arrow button all the time
to get to the next page.
If you alter your url below, replacing
with "bnsviewnav" (and keeping
the rest of the query junk on the end)
you have the link to the specific navbar
for your specific patent.
So, in rebol (watch out for line wrapping):
print page: read url
If you look at that html code and search for TOTPG
you can see "TOTPG=7".
So now you can find out how many pages there are.
find page "TOTPG"
You should not find it difficult to grab the
first number from that string.
Now to construct the urls that point to each page.
If we look back a little bit from we can see
another nice variable "PG":
find page "PG="
Great. Now we can simply modify url, adding
PG=x, where x is your desired page number, for example,
to go to page 3 (watch wrap):
Now to find out how to get directly to each pdf file.
find page ".pdf"
We can see this relative link:
So, here is an absolute link that returns the pdf file for page 3 (watch
This has (my thinking) the essentials, PN, ID and PG.
(You can keep CY and LG if it causes problems).
write/binary %test.pdf read/binary pdf-url
Now, it's up to you to stick it all together into a nice