Merge pull request #301 from orenyomtov/patch-4
Replace lxml with Python's built in html.parser
This commit is contained in:
@@ -209,7 +209,7 @@ class Client(object):
|
|||||||
self.ttstamp = ''
|
self.ttstamp = ''
|
||||||
|
|
||||||
r = self._get(self.req_url.BASE)
|
r = self._get(self.req_url.BASE)
|
||||||
soup = bs(r.text, "lxml")
|
soup = bs(r.text, "html.parser")
|
||||||
|
|
||||||
fb_dtsg_element = soup.find("input", {'name': 'fb_dtsg'})
|
fb_dtsg_element = soup.find("input", {'name': 'fb_dtsg'})
|
||||||
if fb_dtsg_element:
|
if fb_dtsg_element:
|
||||||
@@ -252,7 +252,7 @@ class Client(object):
|
|||||||
if not (self.email and self.password):
|
if not (self.email and self.password):
|
||||||
raise FBchatUserError("Email and password not found.")
|
raise FBchatUserError("Email and password not found.")
|
||||||
|
|
||||||
soup = bs(self._get(self.req_url.MOBILE).text, "lxml")
|
soup = bs(self._get(self.req_url.MOBILE).text, "html.parser")
|
||||||
data = dict((elem['name'], elem['value']) for elem in soup.findAll("input") if elem.has_attr('value') and elem.has_attr('name'))
|
data = dict((elem['name'], elem['value']) for elem in soup.findAll("input") if elem.has_attr('value') and elem.has_attr('name'))
|
||||||
data['email'] = self.email
|
data['email'] = self.email
|
||||||
data['pass'] = self.password
|
data['pass'] = self.password
|
||||||
@@ -277,7 +277,7 @@ class Client(object):
|
|||||||
return False, r.url
|
return False, r.url
|
||||||
|
|
||||||
def _2FA(self, r):
|
def _2FA(self, r):
|
||||||
soup = bs(r.text, "lxml")
|
soup = bs(r.text, "html.parser")
|
||||||
data = dict()
|
data = dict()
|
||||||
|
|
||||||
s = self.on2FACode()
|
s = self.on2FACode()
|
||||||
|
@@ -1,4 +1,3 @@
|
|||||||
requests
|
requests
|
||||||
lxml
|
|
||||||
beautifulsoup4
|
beautifulsoup4
|
||||||
enum34; python_version < '3.4'
|
enum34; python_version < '3.4'
|
||||||
|
@@ -44,7 +44,6 @@ packages = find:
|
|||||||
python_requires = >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4.0
|
python_requires = >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4.0
|
||||||
install_requires =
|
install_requires =
|
||||||
requests
|
requests
|
||||||
lxml
|
|
||||||
beautifulsoup4
|
beautifulsoup4
|
||||||
# May not work in pip with bdist_wheel
|
# May not work in pip with bdist_wheel
|
||||||
# See https://wheel.readthedocs.io/en/latest/#defining-conditional-dependencies
|
# See https://wheel.readthedocs.io/en/latest/#defining-conditional-dependencies
|
||||||
|
Reference in New Issue
Block a user