souravrs999 / FaucetCryptoBot

A bot for FaucetCrypto a cryptocurrency faucet. The bot can currently claim PTC ads, main reward and all the shortlinks except exe.io and fc.lc.
MIT License
124 stars 51 forks source link

I have a suggestion about xpath #12

Closed oyi77 closed 1 year ago

oyi77 commented 3 years ago

Hi, how if you make xpath code more flexible, not based on position but by search. something like this : "//*[contains(text(), 'Get Reward')]" instead of this : /html/body/div[1]/div[2]/main/div/div/div[3]/div[1]/div[2]/div[2]/div[1]/div/div/div[2]/button

souravrs999 commented 3 years ago

Hi I did try this out by partial text matching but only some worked while the others didn't and the bot also lost the ability to figure out which section that particular element belonged to.

oyi77 commented 3 years ago

i've changed some of your xpath with that method, and it works better. i think, you can try to use some function like parent and child to get where the elements exact location. It will take sometime to modify, but it will works like charm, even when the website updating itself.

and maybe you want to try to make bot for autodutchycorp? the logic is actually nearly the same with faucetcrypto. but its generating more money.

Thanks for your hardwork, even you say this is your first bot, but i think its a excellent bot!

souravrs999 commented 3 years ago

Hi mate tnx for the info I'm pretty new to selenium and automation so I'm not well versed enough, I'm also not maintaining this bot anymore cause of huge workloads in my workplace this was more of a side project so I don't know if I will update it in the future looking for contributers currently who can improve the bot.

metapodcod commented 3 years ago

i've changed some of your xpath with that method, and it works better. i think, you can try to use some function like parent and child to get where the elements exact location. It will take sometime to modify, but it will works like charm, even when the website updating itself.

and maybe you want to try to make bot for autodutchycorp? the logic is actually nearly the same with faucetcrypto. but its generating more money.

Thanks for your hardwork, even you say this is your first bot, but i think its a excellent bot!

Could you share your xpath file @oyi77