Python combines selenium automatic collection of hassle-free scripts

Source: Internet
Author: User

First of all, I did not use this script malicious collection of worry-free money, do not seal my account ah, oh, I remember to find a oschina in the past to get a worry-free money script, but it is said to have been lovelorn, recently read a bit about selenium book, this thing is to do web testing, It is said to be very bad, so Balabala looked at a point, and then try to write a script to see if you can automatically receive the worry-free currency, hehe 650) this.width=650; "src=" Http://img.baidu.com/hi/jx2/j_0015.gif "alt= "J_0015.gif"/>, I hereby show that the second script is only learning to use, we do not maliciously collect worry-free coins OH:

The following look at the script, the script itself, for my account early thought, I do not say the specific use of methods and configuration environment, I only paste code, do not seal my account:

#coding =utf-8#!/usr/bin/env pythonfrom Selenium import webdriverimport timebrowser=webdriver. Chrome () url= ' http://home.51cto.com/index.php ' browser.get (URL) username= ' world77 ' password= ' q******* ' Browser.find _element_by_name (' email '). Send_keys (username) browser.find_element_by_name (' passwd '). Send_keys (password) Browser.find_element_by_class_name (' loginbtn '). Click () #browser. Find_element_by_class_name (' Popup_close '). Click () #browser. Find_element_by_class_name (' Hand '). Click () browser.find_element_by_id (' Signto '). Click () #browser. Find _element_by_link_text (U "Collect 2 worry-free coins") #browser. Find_element_by_link_text (U "has been picked up for 1 days") print "Login 51cto success ..." Time.sleep () browser.close () print "Test finished ..."


If interested, you can try it yourself, anyway, the experiment is normal can be picked up oh ...

This article is from "You are a passer-by or fearless" blog, please be sure to keep this source http://world77.blog.51cto.com/414605/1576607

Python with selenium automatic collection of worry-free money scripts

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.