Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MechanicalSoup's browser.form.new_control() breaks compatibility with Mechanize #361

Open
johnhawkinson opened this issue Mar 28, 2021 · 2 comments

Comments

@johnhawkinson
Copy link
Contributor

MechanicalSoup's browser.form.new_control() appears to break compatibility with Mechanize, at least the way I was using it. It would be nice if the Mechanize form were supported too, or at least if there was guidance on this in the documenation.

In Mechanize, I was using:

    br.form.new_control('text', "javax.faces.partial.ajax" ,{'value': 'true'} )

But in MechanicalSoup, it needs to be:

    br.form.new_control('text', "javax.faces.partial.ajax", 'true')
@moy
Copy link
Collaborator

moy commented Mar 28, 2021

Just being curious: why are you porting code from Mechanize to MechanicalSoup?

MechanicalSoup was inspired from Mechanize, but doesn't really attempt any compatibility. It would be rather easy to accept a dict where a string is is currently mandatory, though. No time for this right now :-(.

@johnhawkinson
Copy link
Contributor Author

Just being curious: why are you porting code from Mechanize to MechanicalSoup?

Well, I'd like to say the reason is I wanted connection-reuse, which MechanicalSoup supports via Requests, and Mechanize does not…

But the real reason is that I thought I had found a bug deep inside the guts of Mechanize's urllib2 fork and after tearing my hair out for the better part of the day, I decided it would better to move to MechanicalSoup. Turns out the problem was there too and it was actually a server-side bug, a possibility I had previously eliminated through a faulty diagnostic process. A colleague rightly pointed out I should have set up an https proxy much earlier in my diagnostic process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants