如何登录有密码+验证码的网站

问题描述 投票:-1回答:2

我正在写一个脚本,应该从私人洪流跟踪器中寻找新的视频版本。

所以应用程序已经完成,但我现在需要一种方法来通过登录屏幕,它有验证码,我不知道该怎么做。

当我在浏览器(firefox)上保存凭据时,有没有办法使用我自己的浏览器中的cookie来登录网站?

编辑:

我现在试图完全绕过Captcha,使用cookies,我有一个帐户到我试图进入的网站,我读到应该可以绕过登录并使用cookie访问网站。

我找到了一个例子,但我无法让它发挥作用。这是我试图开始工作的一点:

cookies = {'uid': 'uid_here', 'pass': 'passkey', '__cfduid': 'cfduid'}

        try:
            page = requests.get(url, params=params, cookies=cookies).content

我已经从我自己的浏览器复制的cookie信息,但我不能让自己的工作

我用作参考的全部代码是qazxsw poi

edit2:到目前为止我所拥有的,但它不起作用:

https://github.com/Flexget/Flexget/blob/97bcb6e10f654fbc5a3efa0bc00af6769d73ff69/flexget/plugins/sites/torrentday.py

文档不清楚如何“使用”cookie,或者我不理解它:

cookies = dict(cookies_are ='working')

r = requests.get(url,cookies = cookies)

python cookies request captcha
2个回答
0
投票

对于验证码有一个python包处理它称为def get_torrent(show_list): print('Starting torrent search...') new_eps = show_list file_name = "C:/Users/secret/Desktop/tv_torrents/ " start_url = "https://www.secretsite.com/browse.php?search=" end_url = "&cata=yes" for line in new_eps: # search for *** releases for all series line += ' XAD' s_string = start_url + line + end_url cookies = {'site_cookie': 'ASDDA124fc96fb6776364asdA69c2f5ADAD921514234104'} try: read = requests.get(s_string, cookies=cookies).content soup = BeautifulSoup(read, 'lxml') links = soup.findAll('a') print(soup) torrent_links = ['https://www.secretsite.com/browse.php?search=' + link['href'] for link in links if link['href'].endswith('torrent')] except RequestException as e: raise print('Could not connect to secretsite: %s' % e) else: try: for links in torrent_links: r = request.urlretrieve(links, file_name) print('Success!' + line + ' downloaded') except: print('failed to dl torrent for ' + line) pass ,你需要一个验证码解算器帐户才能得到它(通常它很便宜)只需在谷歌搜索验证码解算器。

我不确定你怎么能用饼干......


0
投票

我想通了,只是一个格式化错误。下面发送cookie数据的正确格式:

captcha2upload

这让我可以通过我自己的浏览器中的cookie来访问验证码并“登录”到网站,我已经登录了该网站。

© www.soinside.com 2019 - 2024. All rights reserved.