我正在尝试登录instagram。这是我的代码
from bs4 import BeautifulSoup
from requests import *
payload = {
'action': 'login',
'username': 'name',
'password': 'pass'
}
with session() as c:
c.post('https://www.instagram.com/login.php', data=payload)
response = c.get('https://www.instagram.com/accounts/edit/')
print(response.headers)
print(response.text)
不幸的是它似乎没有让我登录。我得到:
lt-ie8 lt-ie7 not-logged-in client-root
任何解决办法都将不胜感激。谢谢。
你可以从这里得到实现这个的想法
Logging to Instagram using Python requests
我的instagram登录代码
你需要一个API密钥才能调用instagramapi,而且我不认为你可以直接登录这样的人。
我建议您使用Selenium和PhantomJS webdriver。
相关问题 更多 >
编程相关推荐