jmcarp / jmcarp/robobrowser

Error with two Submits

Open
#61 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
3.7k
Forks
336
PR merge metrics
No merged PRs in 30d

Description

Hello, I have the following form:

`Escreva algo...

João-Wellmara Ribeiro
`

it has two Submits the view_post and view_photo. I'm trying to send the view_post but I'm not succeeding

`>>> br.submit_form(form, form.fields['view_post']) Traceback (most recent call last): File "", line 1, in File "C:\Users\lmr21\AppData\Local\Programs\Python\Python35\lib\site-packages\robobrowser\browser.py", line 339, in submit_form payload = form.serialize(submit=submit) File "C:\Users\lmr21\AppData\Local\Programs\Python\Python35\lib\site-packages\robobrowser\forms\form.py", line 227, in serialize return Payload.from_fields(include_fields) File "C:\Users\lmr21\AppData\Local\Programs\Python\Python35\lib\site-packages\robobrowser\forms\form.py", line 118, in from_fields if not field.disabled: AttributeError: 'str' object has no attribute 'disabled'`

I'm getting this error .. what am I doing wrong?

Contributor guide

Open the contributing guide

Research direction

Start in robobrowser/browser.py at submit_form and follow the call into robobrowser/forms/form.py, especially serialize and Payload.from_fields. Reproduce the example with the view_post field and inspect the field value passed as submit. Done means submitting the selected control no longer raises the reported AttributeError and the intended form action is preserved.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.