Hey, I'm hoping to make bots that automate tasks in a browser. I have a quite a bit of programming experience in PHP, however that wouldn't work for this type of task. I can understand the fundamentals of C#, but what should I look into if I want to create this type of thing.
Thanks,
mrphp
You can invoke a web browser control but it would be better to do web requests.
DO NOT DEAL WITH THIS MEMBER
Look into the robot framework, can't get any simpler, or search for "Selenium webdriver". Not sure if there's a C# port, but there are other tools out there. You can also play around with Jasmine/Mocha if you know javascript.
I always start people off with the robotframework.
DO NOT DEAL WITH THIS MEMBER
(Aug 11, 2017 01:53 PM)VouchPotato™ Wrote: Look into the robot framework, can't get any simpler, or search for "Selenium webdriver". Not sure if there's a C# port, but there are other tools out there. You can also play around with Jasmine/Mocha if you know javascript.
I always start people off with the robotframework.
I googled robotframework and found something related to testing.
Aug 11, 2017 04:36 PM
(This post was last modified: Aug 11, 2017 04:40 PM by hackpet.)
Depending on exactly what you want to achieve (or how "nice" do you want to do it), you have more options (i'll list only the ones i've used):
- Using the build in webbrowser and invoke actions on the elements
- Using webrequest, imitating the browser (Now i have made a Forge of Empires bot using this method)
- Use sockets for the communication (i do NOT recommend this, it's pointlessly complicated, just listed it, bc i've tried it before)
So maybe if you tell us, what you want to do, we may be able to help better.
PS.: Oh, i almost forgot, you can imitate simple user clicks and keypresses, but thats really a pain in the ass, if the form changes etc,etc... (Also, you cant do other things, bc if i know well, you can send inputs only to the active window, if this is not true, i would be happy to learn a way to do it :) )
@hackpet and all others I'm hoping to do this with web requests. Is there anything else to know if I am planning on doing it that way?
Aug 11, 2017 05:57 PM
(This post was last modified: Aug 11, 2017 06:00 PM by hackpet.)
(Aug 11, 2017 05:04 PM)mrphp Wrote: @hackpet and all others I'm hoping to do this with web requests. Is there anything else to know if I am planning on doing it that way?
One more tip, which may be useful. I used Fiddler to log all the communication between me and the webserver, this way i could "copy" the syntax of that.
If you need any help just feel free to ask ;)
DO NOT DEAL WITH THIS MEMBER
Aug 11, 2017 08:30 PM
(This post was last modified: Aug 11, 2017 08:31 PM by Ninja.)
(Aug 11, 2017 05:04 PM)mrphp Wrote: @hackpet and all others I'm hoping to do this with web requests. Is there anything else to know if I am planning on doing it that way?
Get a packet sniffer like Fiddler or Charles so you can sniff the HTTP requests, then emulate them using WebRequests (or WebClient (or HttpClient)). If you want to use WebRequests, I made some extension methods:
https://hackforums.net/showthread.php?tid=5530456
For WebRequests (or WebClient (or HttpClient)) you have to do session handling yourself, unlike the WebBrowser. You do this using a CookieContainer.
Selenium is a very, very easy way of controlling a browser programmatically.
(Feb 3, 2018 03:19 PM)kickball34 Wrote: i'm gonna get your ip address and rat your pc.
DO NOT DEAL WITH THIS MEMBER
(Aug 11, 2017 03:00 PM)Ninja Wrote: I googled robotframework and found something related to testing.
That's what it was made for, but you can automate whatever you want, doesn't need to be a test automation.
|