I am running the following Jython code which is part of an online example of
very simple web scraping:
# always empty
URL = "http://www.amazon.com/exec/obidos/tg/detail/-/0140390847/ \
pattern = "Sales Rank: </b> *([0-9,]*)"
doc = urllib.urlopen(URL).read()
result = search(pattern, doc)
The problem is that we have a firewall and have to use a proxy to get to the
web. I have tried specifying the java system properties http.proxyHost and
http.proxyPort, as well as calling PythonInterpreter.initialize( ) with a
property keyed on "http_proxy", which is apparently the convention for
specifying proxies with urllib (see
http://www.python.org/doc/current/lib/module-urllib.html). I am not sure
what to try next. As noted in the code, printing out the list of proxies
always gives me an empty list even when trying to specify the proxy using
aforementioned methods. Any pointers would be greatly appreciated.
Thanks in advance,
java version "1.4.2_03"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_03-b02) Java
HotSpot(TM) Client VM (build 1.4.2_03-b02, mixed mode)
Jython 2.1 on java (JIT:null)
Microsoft Windows 2000 [Version 5.00.2195]