The following workaround will allow ParseHub to solve the two-step verification that certain websites require in order to log in.
1. Click on the + sign next to "Select page" and use a Select command to select the username field. ParseHub should already add an Input command by default name where you can input your username or email address.
If you need more information on how to add a login to a template on your project, please refer to the tutorial here.
2. Click on the + sign next to "Select page" and use a Select command to select the password field. ParseHub should already add an Input command by default name where you can input your password.
Note that you can also double-click on any selection to rename it (e.g. from "selection1" to "username") which will help make your project more descriptive. We have done this below.
3. Click on the + sign next to "Select page" and create a Select command. Use that to select the "Sign in" button and then click on the + sign next to that selection and add a Click command. We will choose "No" when asked if this is a next page button, and then choose the "Create new template" option and call it "2F_A", for example.
4. If you see the Two-Factor Authentication screen skip to Step 6.
If you've logged in to the website on your computer before, you will be directed straight to the post-login page. However, when the project is run on our servers, the two-factor authentication page will pop up. In order to see this page to set up commands on it, you'll have to add a Server Snapshot command to your two-step verification template and run your project on our servers.
5. Once your project has finished running, click on the Server Snapshot at the bottom of your run page to open it. This will allow you to set up commands on the page as if you are actually viewing it.
6. On some websites you need to click on another button before the code is sent to your email. Use Select/Click commands to click on the button.
Again, set up a Server Snapshot command (on the two-step verification 2 template this time) and re-run your project.
7. Now that we have the code being sent to our email address, we can set up the steps to input the code into the website. On the 2FA-2 template, click on the + sign next to "Select page" and add a Wait command. Extend the wait period on this command to 600 seconds.
Setting up your project to Input a code you have received through email or text message
1. On a Google Drive account, create a Google Sheets document and choose the option to "Publish to the web" under File:
2. Click on "Publish" and you should find a link that you can copy.
3. On ParseHub, click on the + sign next to "Select page" on your 2FA-2 template, click on Advanced and choose a "Go To Template" command. On the pop-up that appears, click on "Go to URL" and enter the link you copied in the previous step (in quotation marks). Then choose the "Create New Template" option below and call that "scrape code", for example.
4. Click on the + sign next to "Select page" on the scrape code template and add a Select command. Use this command to select the (currently) empty cell on the spreadsheet. Rename this Select command to "code".
5. Go back to the tab that has your Server Snapshot of the code input field. On the two-step verification 2 template, click on the + sign next to "Select page" and add a Select command. Use it to select the code input field.
6. An Input command will be automatically created for you when you Select the code input field. From the Input command's settings, choose "expression" from the dropdown menu, and then enter the word "code" into the text box. This refers to "code" command on the scrape code template, which will scrape the verification code from the Google Sheet.
7. Switch to Browse mode and type in the code that was sent to you via email/text. Use Select/Click commands to click on the button. You will then add the "Select" command from "Select" page to the element that verifies or submits your code and a click by clicking on the + sign next to "Select" and adding a click command. This click will be going to the login landing page, so be sure to create a new template with this click.
Whenever you run your project, you'll receive an email/text with a code that you need to input into the website. When you receive the code, you'll have to input the code into the Google Sheet that you published. Try to input the code into the sheet as soon as possible so that the code is in the sheet before the 600-second wait ends.
You can now continue to build your project as normal using our other tutorials. For example, if you scraping an eCommerce website like Amazon, you may find our Example Tutorial for building your first project helpful.
Tags: 2-Step Verification, 2-Step Authentication, Two-Step Verification, Two-Step Authentication, Two Step Verification, Two Step Authenticatio