Step-by-step tutorials for you to get started with web scrapingDownload Octoparse
Extract data behind a loginThursday, July 15, 2021
The latest version for this tutorial is available here. Go to have a check now!
Enter login information to sign in
- Click on the textbox for username input on the web page
- Select "Enter text" from Action Tips
- Input the username into the textbox
- Click "OK", the username entered is automatically populated to the username textbox on the web page
- Follow the same steps to enter the password
- Click the "Sign In" button on the page
- From Action Tips, select "Click button"
Octoparse has now logged in the website successfully!
1. Save cookies
Most of the time, you can optimize the workflow by saving the cookie in the task after login. This way, Octoparse will send the saved cookie to the website at loading, and there's a good chance the website will remember "you" and skip the login steps.
- Log in the website in Octoparse's built-in browser if you have not already done so.
- Switch to the Workflow Mode by toggling the Workflow switch on the top, drag a "Go To Web Page" action to the workflow, position right below the sign in steps.
- Enter the URL of the page needed for the capture into the text box for "Page URL"
- Under "Advanced Options", click open "Cache Settings"
- Select "Use specified Cookie"
- Click "Load cookie from current web page"
- Click "OK" to save the settings
- Now as the web page is supposed to "remember" the login and skip the login steps, we'll remove the previously created actions for the login to avoid running into issues when the workflow is executed. Right-click on the action and select "Delete".
A saved cookie is only effective before it gets expired
Cookies come in many different forms. Some have a specific expiration time, others expire immediately as the browser is closed. In Octoparse, the saved cookie will no longer work when it gets expired. To solve this, you will need to go through the log in steps once again by adding in the proper actions in order to obtain and save the updated cookie.
Your password is well-protected
· In Octoparse, when you enter your password, it is only accessible on your own account. When a task is exported, the password saved in the task gets removed automatically by Octoparse.
· Any login information saved will be removed from your account permanently as soon as the task is deleted.
2. Clear cookies
As all websites handle cookies differently, to ensure the task workflow will work consistently, you may want to start with the login steps every time the task is executed. To do this, you can clear any cookies saved before the login page is loaded. This way, the target website will always "forget" you and takes you to the login page on which you can enter all the login information.
- Click "Go to Web Page" action for the login page
- Select "Clear cache before opening the web page" within Cache Setting
Entering captcha manually while running local extraction
· When captcha is encountered, you can manually input the captcha when running the task locally. Cloud Extraction doesn’t support dealing with Captcha.
· Currently Octopares only supports digital captcha and does not support other types, such as reCaptcha v2.
- Most popular tutorials
- Use lists to extract
- Set up proxies
- Scrape data via Google Searching
- Extract data from source code
- How to export extracted data to a database?