Bewest/fix form view url#4
Open
bewest wants to merge 2 commits into
Open
Conversation
Based on jpf#3 (comment) This should allow the newer google URLs to work.
Simplify the html scraping a bit This appears to do the right thing: https://docs.google.com/forms/d/1TLHCRZWsLt7huSzqlLoqA0MIHYT9n5xZRo4bRSotvlw/viewform ```python >>> reload(gform) <module 'gform' from 'gform.pyc'> >>> s 'https://docs.google.com/forms/d/1TLHCRZWsLt7huSzqlLoqA0MIHYT9n5xZRo4bRSotvlw/viewform' >>> k '1TLHCRZWsLt7huSzqlLoqA0MIHYT9n5xZRo4bRSotvlw' >>> >>> G = gform.GForm(k, s) >>> G.show_state( ) Parameters: {'entry.323738588': '', 'entry.1914238709': '', 'submit': 'Submit', 'entry.471541577': ''} Labels: {'To': 'entry.1914238709', 'SmsSid': 'entry.323738588', 'From': 'entry.471541577'} >>> ``` Without this patch I get the following errors: ```python >>> reload(gform) <module 'gform' from 'gform.py'> >>> G = gform.GForm(k, s) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "gform.py", line 48, in __init__ input_label = elements[0].text.rstrip() AttributeError: 'NoneType' object has no attribute 'rstrip' >>> ```
Owner
|
Thanks for this pull request Ben, I really appreciate it. I'll have to take a look at this in more depth before I merge in your changes, in particular, I want to make sure that existing setups of TwilioSheet will not be impacted. Also, a bunch of my tests are failing, so I'll need to figure out what that means. This is just the shove I needed to get this all fixed, thanks for sending this along. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Based on the information I have available on hand, this should help fix #3 (comment)
I've tested in locally on my console to make sure some data gets generated, and running the
app.pylocally says that it works: