233 questions
1
vote
1
answer
55
views
How do I post directly to a specific URL with Python Mechanize?
With perl's mechanize module, nearly anything seems possible. But I'm not using perl, unfortunately, I still expected to be able to do what was needed with python. The login page that I have to ...
1
vote
0
answers
51
views
Getting Contents of a Webpage Form After Submission with Python
I want to learn how to submit values to a webpage form by using python. I have created the following web page
http://www.vproce.net/deu-hdp.html
I want to submit the following values to the form ...
-1
votes
1
answer
290
views
How to get cookie after login using mechanize
import mechanize
import json
import re
from bs4 import BeautifulSoup
import requests
browser = mechanize.Browser()
class login:
def __init__(self):
email = "aaaa"
...
0
votes
1
answer
67
views
How to edit page code with python mechanize?
I have some code on page like this:
<div class="tabs1_cnt" id="pupil_tabs_content_2189609">
<div class="pupil_tabs_content_item tabs1_cb" id="...
1
vote
0
answers
137
views
How to fill a form input field using its ID rather than the form name with mechanize?
I am trying to automate geocoding with python. There is a simple website that does this, but I don't want my user to manually visit the website. I want to automatically take his adress and convert it ...
0
votes
1
answer
259
views
Can't login using mechanize from python. What am I doing wrong?
I'm trying to use mechanize in python to login to this site: https://login.haaretz.co.il/
On the surface, it looks like a 2-phase login process, same as google, but following receipts for google login ...
1
vote
0
answers
327
views
Webscraping in Python a page with login and redirection
I am trying to login to a financial service I am a customer to retrieve automatically some data by using Python requests.
I have been inspired by this page:
import requests
from typing import Dict
...
1
vote
1
answer
3k
views
OAuth2 Grant Type - authorization code (python)
I am try to figure out how to get Oauth 2 working in my python code.
import requests, json
import webbrowser
authorize_url = "https://tcfhirsandbox.com.au/oauth2/authorize"
token_url = &...
1
vote
0
answers
434
views
Can't find form name with python-mechanize
I just started playing around with python. Recently I stumbled upon web scraping and I thought that it would not be that hard to make a Kahoot (https://kahoot.it/) bot. You may or may not know what I'...
5
votes
1
answer
2k
views
How to fill and submit a form using python
I am filling a form of a web page with the help of mechanize module but I am getting error when I run my code.
I just want to fill the form and submit it successfully.
My attempt :
code snippet from ...
1
vote
1
answer
192
views
Transfering login from mechanize to urllib or requests
I'm currently trying to transfer some of my code to either urllib3 or requests. urllib3 would be the preferred method to reduce the modules imported.
This is the code currently working.
payload = [&...
0
votes
1
answer
342
views
Python + Mechanize - Emulate Javascript button click using POST?
I'm trying to automate filling a car insurance quote form on a site:
(following the same format as the site URL lets call it: "https://secure.examplesite.com/css/car/step1#noBack")
I'm ...
-1
votes
1
answer
55
views
This Python program isnt working and their is no apparent reason [closed]
I found this code online and I tried my best to patch it. I don't understand whats wrong with this program. This code takes in Netflix accounts and outputs the working accounts.
import mechanize
...
0
votes
1
answer
186
views
Python Mechanize, how to get URL parameters
I'm currently working on website scraper. Because I have to log in to access the website, a session ID has to be generated and saved for further usage.
The session ID is at the end of the URL.
https://...
0
votes
1
answer
115
views
Python mechanize check if field is required
I am trying mechanize library to register a user. There are 4 fields firstname, lastname, email, password. Every field is required but If I run this code it runs successfully and doesn't give error ...
0
votes
0
answers
132
views
Unable to set proxy in mechanize.browser successfully
I am writing an application where it retrieves data from a film database. To achieve the same, I am using BeautifulSoup and Mechanize for the same.
Thus, while setting the proxy as with in the below ...
0
votes
1
answer
2k
views
requests.exceptions.ConnectionError: Failed to establish a new connection: 0x05: Connection refused
I know there are already alot of topics writing about this topic, but none could held me.
import mechanicalsoup
browser = mechanicalsoup.StatefulBrowser()
browser.set_user_agent(
'Mozilla/5.0 (...
0
votes
1
answer
855
views
How can I use the CSS selector to select a form when there are multiple forms on a page?
I am trying to fill out a specific form on a webpage but the CSS selector I am using returns an error
I have tried these separately:
1. browser.select_form('form[method="post"]')
2. browser....
0
votes
1
answer
227
views
WIPO search missing form data POST message
i am trying to search trough the WIPO brand register with python, but if i am checking the formdata which got send to the server i don't really understand what this is.
Form Data:
This is the ...
0
votes
1
answer
2k
views
What is mechanize.CookieJar() in mechanize Python?
I've recently been working on a script that accesses a website's form to log in. Tried with requests but it seems that mechanize works better for this application. Was asking around and I wrote this ...
0
votes
1
answer
48
views
How to overcome ItemsNotFoundError in mechanize when working with hidden forms
I am creating a script that submits a form. The problem I am facing is that some options are hidden and do not show options (in HTML source code), until other fields are filled.
The error I am ...
0
votes
0
answers
256
views
mechanize gives AttributeError: class HTMLForm has no attribute 'did_submit'
I am attempting to run search button in "https://www.facebook.com/login/identify/?ctx=recover&ars=royal_blue_bar" using mechanize but it shows me:
AttributeError: class HTMLForm has no attribute '...
0
votes
0
answers
110
views
mechanize._mechanize.FormNotFoundError: no form matching id = 'polls_form_25' while filling out form with mechanize
Basically what the title says. I'm trying to automatically fill out a form containing radio buttons, but I keep getting this error from line 7.
mechanize._mechanize.FormNotFoundError: no form ...
1
vote
0
answers
27
views
How to submit a form on Mechanize then submit to the next form that loads
Sorry if the title is poor. This code is copied, so I don't know what the first few lines do.
The site I want to scrape first asks for the email, which after submission asks for the password. When I ...
1
vote
1
answer
436
views
File upload through python mechanize
I am trying to upload image file into the browser using mechanize.
Although there is no error, the uploaded file does not reflect when I check manually in the browser (post submit/saving).
I am using ...
0
votes
1
answer
451
views
What's the difference between click and submit in Mechanize?
I am trying to log in to Facebook using Mechanize.
I have written these two different scripts to log in:
Script 1
br = Browser()
br.set_handle_robots(False)
userName = 'My EmailID'
password = 'My ...
6
votes
5
answers
1k
views
Mechanize: too many values to unpack (expected 2)
I have tried to write the following code, I am trying to write a code in Python 3.7 that just opens a web browser and the website fed to it in the Command Line:
Example.py
import sys
from mechanize ...
0
votes
0
answers
70
views
python mechanize import failing with python 2.x
Mechanize is not working with python 2.x while using "Browser" in mechanize failing.
import re
from mechanize import Browser
br = mechanize.Browser()
br.open("https://en.wikipedia.org/wiki/...
0
votes
1
answer
3k
views
How to send raw JSON data with a post request using mechanize in python
I am trying to POST JSON data to a api using a python script. I'm using python 2 and mechanize package.
import mechanize
import json, logging, sys, urllib
br = mechanize.Browser()
url = 'url_here'
...
0
votes
0
answers
818
views
Python Web scraper for dynamically populating drop down list (using mechanize and beautifulsoup(
i am newbie to python. I am using python 2.7 and trying to scrape the website and collect the data . I am having issue in selection of drop down list and getting new response form with updated list of ...
3
votes
0
answers
231
views
Python Mechanize response is empty
I need the response in order to make Python decide what to do next, but the response keeps being empty. What could be the problem?
import mechanize
br = mechanize.Browser()
br.set_handle_robots(...
0
votes
1
answer
195
views
How to get cookies from mechanize to use in pdfkit
Does anyone know how to get a cookie that I have logged into using mechanize browser, so that I can use those urls in pdfkit? I have looked around a bit, but can't manage to see how to get a cookie in ...
0
votes
1
answer
281
views
python mechanize - cannot submit login form
I am using mechanize (http://wwwsearch.sourceforge.net/mechanize/) to login to www.coinotron.com, but the execution hangs when I do br.submit()
import mechanize
...
br = mechanize.Browser()
br....
-1
votes
1
answer
186
views
Mechanize not logging in?
I'm very new to python, and I'm trying to scrape a webpage using BeautifulSoup, which requires a log in.
So far I have
import mechanize
import cookielib
import requests
from bs4 import ...
-1
votes
1
answer
192
views
Trying to get Facebook account password too often locks me out
I was locked out of my Facebook account for a few hours after I tried to make a script get my password (I already know my account's password). Do I have a problem in my python script, or is the way I ...
1
vote
0
answers
176
views
Extract table rows from iframe with python, mechanize and BeautifulSoup
I've been trying and looking for help like crazy, and I have not been able to solve this issue. Could you please help me on getting the table content inside the iFrame... On my code I was able to ...
1
vote
0
answers
134
views
How to select controls inside a table that is inside a form - mechanize?
<form method="post" action="/user/user_login_prov.jsp">
<table id="userpass" class="separator">
<tr class="gap"><th> </th><td> </...
1
vote
0
answers
125
views
howto solve import error in mechanize module
I'm trying to learn mechanize module but getting this import error while doing the basic thing
I got this error
Traceback (most recent call last):
File "C:/Users/HUNTER/PycharmProjects/...
0
votes
0
answers
70
views
Python Mechanize problems with form finding
I have been trying to make a program with Mechanize to comment on "https://scratch.mit.edu/projects/138659469/" but it hasn't been working and I don't know why.
I don't know which form number it is, ...
1
vote
1
answer
2k
views
Login with python mechanize
I am trying to create a python script that uses mechanize to submit data to a web form.
This is what I have so far
import mechanize
username = <my_username>
password = <my_password>
url =...
1
vote
1
answer
2k
views
Submitting data with python mechanize
Im trying to submit a form by submitting to this submit button
<div class="input-btn">
<a class="iconized post-clear" href="" ng-show="!postdata.data.$error.required" ng-click="...
0
votes
0
answers
494
views
Can we use Python Mechanize with Scrapy?
I am new to Python and Scrapy. I have to auto login my university student portal and then scrape student data out of that website. Can I do the autoLogin with mechanize and then scrape the data with ...
0
votes
2
answers
512
views
How to use multiprocessing in a for loop - python
I have a script that use python mechanize and bruteforce html form. This is a for loop that check every password from "PassList" and runs until it matches the current password by checking the ...
0
votes
0
answers
42
views
Getting an error I don't understand while trying to scrape Google for links
I'm very new to Python so I apologize if this is an easy question, I'm trying to write a web scraper to scrape Google for all relevant links pertaining to networking, using BeautifulSoup, and ...
2
votes
0
answers
248
views
how to login on paypal using mechanize in python?
I have to login on paypal using mechanize in python.I tried many codes but invent.Same code is applicable for login on gmail but not work for paypal login.I tried code below..
import mechanize
from ...
0
votes
1
answer
487
views
How to deal with an 'endless' webpage when scraping
I'm making a scraper to grab a list of my friends from facebook then scrape a list of mutual friends from them, with goal of constructing a web with the data. I looked at the official facebook api, ...
0
votes
1
answer
309
views
Thread timer issues python
I am trying to use the thread.Timer class, but I keep getting crashes.
Here is the idea : i have a code that launches an optimisation on a web application. When the optimisation is launched, i want to ...
0
votes
1
answer
1k
views
Using Mechanize To login to gmail
I am trying to scrap gmail.com and have used mechanize to authenticate but since gmail has two step authentication it was quite tricky but i managed to login but i face loading problem.
My code is
...
0
votes
1
answer
86
views
How to "patch" _response.py in Mechanize
I had a issue with ntlm authentication and mechanize. After going through the below post i understood that i need to modify the _response.py file of mechanize.
Use python mechanize to log into pages ...
0
votes
0
answers
688
views
Python Mechanize - Get control by name in a page that has no forms
I want to set a value to a select control but there is no form in the html, so when I try to get the component by name, like this:
br.select_form(nr=0)
br.find_control(name="selectName").value = ["...