Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

1
Skip bad data with Selenium
Post Body

I am using python, with Selenium and Openpyxl to do a script that performs the following:

1) It reads data from an excel datasheet.

2) It uses the data from the sheet to automatically fill a form on a website.

The script seems to be working fine under normal circumstances, but the if there is missing data on one of the fields it reads from the excel, or if for example one of the data it reads is not in one of the dropdowns options of the page it will fail.

What I want to do is to modify the script so, if it detects an error of that type, it logs the error on a separate file, skip the faulty row and continue with the rest and throws a warning at the end, but I have no idea how to do this, as I don't know how to read error messages from the python.

Any advance would be appreciated.

Bonus question for people with more experience

1) The webform is on a private network that I have only access for testing once a month.

2) Is there any way to save an offline version of it only for testing, if doable, what precautions or what should I modify on the html code of the site?

Author
Account Strength
90%
Account Age
5 years
Verified Email
Yes
Verified Flair
No
Total Karma
3,842
Link Karma
1,273
Comment Karma
2,495
Profile updated: 1 week ago
Posts updated: 1 year ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
3 years ago