Get Gitlab link page content in html

可紊 提交于 2020-04-11 17:26:57

问题


I am having the same use case as here. I would like to access to the gitlab page to get html page content (private repo) but it always direct me to sign in page even I already pass the authentication which I refer to here

Below is my code:

import urllib, re, sys, requests
from bs4 import BeautifulSoup

LOGIN_URL = 'https://gitlab.devtools.com//users/auth/ldapmain/callback'

session = requests.Session()

data = {'username': username,
        'password': password,
        'authenticity_token': token}
r = session.post(LOGIN_URL, data=data)

print r.status_code
url = "https://gitlab.devtools.com/Sandbox/testing/merge_requests/2" 
html = session.get(url)
print html.url

Any idea on this? Am I missing anything?

来源:https://stackoverflow.com/questions/61076135/get-gitlab-link-page-content-in-html

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!