jihoonham / spynner

Automatically exported from code.google.com/p/spynner
GNU General Public License v3.0
0 stars 0 forks source link

deepcopy for browser objects #30

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I need to have a deepcopy of my spynner.Browser() object, but when I try to do 
it, I get an error message:

TypeError: instancemethod expected at least 2 arguments, got 0

Is there a way to create deepcopies of Browser objecs? 
Thanks in advance

Original issue reported on code.google.com by akcali.ozgur on 22 Jul 2011 at 11:11

GoogleCodeExporter commented 9 years ago
I have took a little look in the code, and it deosn't seem possible to have a 
deepcopy of a Browser object.

Then, is there a way to go back to the previous page with spynner?

Original comment by akcali.ozgur on 23 Jul 2011 at 11:00

GoogleCodeExporter commented 9 years ago
Actually, I've just solved it, sorry for the inconvenience, if I have taken any 
of your time. I'm just writing here how I did it to help the others:

br = spynner.Browser()
...
load some pages here
...
if br.webpage.history().canGoBack():
    br.webpage.history().back()
    br.wait_load()
else:
    # There are no pages in the history that can be visited again, then.

Original comment by akcali.ozgur on 23 Jul 2011 at 11:56

GoogleCodeExporter commented 9 years ago
ok, thanks for the info, it seems a good way, spynner is just a thin wrapper 
over webkit, you can directly access the objects.

Original comment by tokland on 24 Jul 2011 at 4:31