0

Is there any module or way in python for filling web form without using selenium

8
  • Is that google forms? Commented Aug 8, 2020 at 7:56
  • any type of web forms @heitor Commented Aug 8, 2020 at 7:57
  • without selenium @DaveIdito Commented Aug 8, 2020 at 7:59
  • Any specific reasons why you are avoiding Selenium? Commented Aug 8, 2020 at 8:00
  • 1
    Well, there's lots of ways to do it, depending on the website you could use an API (take a look at this for google forms). Or just use the network inspector tool to find out what requests your browser is making and try to mimic them using requests for example. But Selenium is a pretty versatile solution since many websites have anti-automation measures and don't work well with plain requests without user-agents. Commented Aug 8, 2020 at 8:04

1 Answer 1

1

For multiple reasons, logging into sites like Gmail and Facebook using WebDriver is not recommended. Aside from being against the usage terms for these sites (where you risk having the account shut down), it is slow and unreliable.

The ideal practice is to use the APIs that email providers offer, or in the case of Facebook the developer tools service which exposes an API for creating test accounts, friends and so forth. Although using an API might seem like a bit of extra hard work, you will be paid back in speed, reliability, and stability. The API is also unlikely to change, whereas webpages and HTML locators change often and require you to update your test framework.

Logging in to third party sites using WebDriver at any point of your test increases the risk of your test failing because it makes your test longer. A general rule of thumb is that longer tests are more fragile and unreliable.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.