b = bot() b.get('http://googe.com') # Вывод html-кода print b.text
Клас bot пробую создать так:
import requests class bot(requests.Session): def __init__(self, headers=None, cookies=None, auth=None, timeout=None, proxies=None, hooks=None, params=None, config=None, prefetch=True, verify=True, cert=None): self.text = None requests.session.__init__(self, headers=headers, cookies=cookies, auth=auth, timeout=timeout, proxies=proxies, hooks=hooks, params=params, config=config, prefetch=prefetch, verify=verify, cert=cert) def get(self, url, headers=None, cookies=None, auth=None, timeout=None, proxies=None, hooks=None, params=None, config=None, prefetch=True, verify=True, cert=None): self.text = self.get(self,url, headers=None, cookies=None, auth=None, timeout=None, proxies=None, hooks=None, params=None, config=None, prefetch=True, verify=True, cert=None).text