Webbrowser automatically clicks link ad automatically clicks ads auto click

Source: Internet
Author: User
Click paid advertisements are currently a popular online marketing model. However, if you simply click them one by one, you always feel that it is not cost-effective. Can you click them automatically? The answer is yes.
The webbrowser in. Net can satisfy our requirements. If you use the ideas in this article to make money, you will be at your own risk ( However, at present, this kind of thing is not easy to do, and various paid websites have taken measures to cope with it. Haha, the magic is full of feet, and the implementation is still feasible. It depends on everyone to make full use of it.)

The following is a part of the core code.

Private void webbrowserappsdocumentcompleted (Object sender, webbrowserdocumentcompletedeventargs E)
{
// Call the automatic logon process if you need to log on
// This. autologon ("Account", "password ");

// Obtain all links on the target page, analyze these links, and find the link to be clicked.
Htmlelementcollection links = This. webbrowser1.document. links;
Foreach (htmlelement link in links)
{
// Here I use the Google link for Example
If (link. getattribute ("href"). Contains ("Google.com "))
{
Link. invokemember ("click"); // click an event that triggers a link.
}
}
}

/// <Summary>
/// Automatic login, applicable to the absence of Verification Code
/// </Summary>
/// <Param name = "userid"> Logon account </param>
/// <Param name = "password"> logon password </param>
Private void autologon (string userid, string password)
{
# Region obtain the logon form input box and submit button
Htmlelement textboxuserid = This. webbrowser1.document. getelementbyid ("ID of the login username text box ");
// If there is no ID, use name to get it
// Htmlelement textboxuserid = This. webbrowser1.document. All ["Name of the login username text box"];

Htmlelement textboxpassword = This. webbrowser1.document. getelementbyid ("ID of the logon Password box ");
// If there is no ID, use name to get it
// Htmlelement textboxpassword = This. webbrowser1.document. All ["name in the logon Password box"];

Htmlelement buttonsubmit = This. webbrowser1.document. getelementbyid ("Login button ID ");
// If there is no ID, use name to get it
// Htmlelement buttonsubmit = This. webbrowser1.document. All ["Name of the logon button"];

Textboxuserid. setattribute ("value", userid); // enter the account
Textboxpassword. setattribute ("value", password); // enter the password

Buttonsubmit. invokemember ("click"); // click the event that triggers the submit button

// Of course, you can log on or use
// This. webbrowser1.document. Forms [0]. invokemember ("Submit ");
//. However, the preceding statement skips the browser client verification function (if any)
# Endregion

// After logging on, you must determine whether the logon is successful. You can use the URL
// Or this. webbrowser1.document. Body. innerhtml content to determine
}

 


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.