1
import requests
from bs4 import BeautifulSoup
URL = "http://india-bugzilla/Games/index.cgi"
headers = {
    'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.146 Safari/537.36'
}
login_data = {
    "username": "[email protected]",
    "password": "xxxx",
    "GoAheadAndLogIn": "Log in"
}
with requests.Session() as s:
    url = 'https://bugzilla.mozilla.org/home'
    r = s.get(url, headers=headers)
    soup = BeautifulSoup(r.content, 'html.parser')
    login_data['Bugzilla_login_token'] = soup.find('input', attrs={'id':'token_top'})['value']
    r = s.post(url, data=login_data, headers=headers)
    print(r.content)

It throws the below error "Bugzilla needs a legitimate login and password to continue." inside the HTML content.

3
  • This URL is not loading. Any base url? Commented Feb 16, 2021 at 9:03
  • This URL is accessible only in the intranet, We use bug zilla version 5.0.3 Commented Feb 16, 2021 at 9:06
  • @SamsulIslam Updated the code to the base URL, Can you look into it now ? Commented Feb 19, 2021 at 6:36

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.