[Tutor] how to use lxml and win32com?

Alan Gauld alan.gauld at btinternet.com
Mon Oct 26 16:18:11 CET 2009


"elca" <highcar at gmail.com> wrote

>>> i want to use IE.navigate function with beautifulsoup or lxml..
>>> if anyone know about this  or sample.
>> Why do you want to use navigate()? What are you trying to do?
>> There is likely to be another way to do it from Python.

> so why i try to use PAMIE or IE
> http://elca.pastebin.com/m52e7d8e0
> i was attached current scraper script source.

OK TherR are several problems in there.
First, are you sure you want to define the function getit() inside a
while loop? (I'm pretty sure you don't) And are you sure you want
the function to recurse infinitely - see the last line (I'm pretty sure you
don't)
Next, do you really want page_check()  to sleep for 13 seconds?
(Once per letter in the url)


> especially  i want to change 'thepage = urllib.urlopen(theurl).read()' to
> PAMIE method.

And you still don't explain why you don;t want to use urlopen?
What advantage does using PAMIE offer? I'd expect it to be slower
and more memory hungry (since it uses IE under the covers).

HTH,


-- 
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/ 




More information about the Tutor mailing list