I want to get the source but I have the ERROR
:
>> from selenium import webdriver
>> driver = webdriver.PhantomJS()
>> url='http://google.com'
>> cont=driver.page_source(url)
>> print cont
>> driver.quit()
ERROR:
Traceback (most recent call last):
File "u.py", line 6, in <module>
cont=driver.page_source(url)
TypeError: 'unicode' object is not callable
This error occurs when we call unicode objects as a function. For example:
a = u'this is unicode string'
if you do a()
somewhere in code you get this error
In your case as pointed out page_source
is a unicode string and not a callable function. So this page_source(url
) is giving above error.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With