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".
1. 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.
2. Your password is well-protected
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
[Video version of this tutorial is available here]
Artículo en español: Extraer datos detrás de un inicio de sesión
También puede leer artículos de web scraping en el sitio web oficial.