I cannot get this to work. I keep adding modules and there's a new one not found each time. Why doesn't this code work in Python3.6?
Code:
from robobrowser import robobrowser
from bs4 import BeautifulSoup
import urllib2
import cookielib
from werkzeug import werkzeug
from cached_property import cached_property
cj = cookielib.CookieJar()
br = robobrowser.Browser()
br.set_cookiejar(cj)
br.open("https://www.cbssports.com/login")
br.select_form(nr=0)
br.form['userid'] = 'steveb1164'
br.form['password'] = ''
br.submit()
print(br.response().read())
Run:
RESTART: C:/Users/Steve/AppData/Local/Programs/Python/Python36-32/CBSlogin.py
Traceback (most recent call last):
File "C:/Users/Steve/AppData/Local/Programs/Python/Python36-32/CBSlogin.py", line 1, in <module>
from robobrowser import robobrowser
File "C:\Users\Steve\AppData\Local\Programs\Python\Python36-32\lib\site-packages\robobrowser\robobrowser\__init__.py", line 3, in <module>
from .browser import RoboBrowser
File "C:\Users\Steve\AppData\Local\Programs\Python\Python36-32\lib\site-packages\robobrowser\robobrowser\browser.py", line 8, in <module>
from werkzeug import cached_property
ImportError: cannot import name 'cached_property'
I got the werkzeug app running in Python 3.6 by inserting those lines before the Flask importing:
import werkzeug
werkzeug.cached_property = werkzeug.utils.cached_property
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