![]() |
|
[Python] Python bot for whatsapp spamming. (getting error) - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [Python] Python bot for whatsapp spamming. (getting error) (/showthread.php?tid=5884087) |
Python bot for whatsapp spamming. (getting error) - kookur - Sep 12, 2018 Code from selenium import webdriverError i'm getting : Code Traceback (most recent call last):I'm very newbie to python, learning basics and learning automating stuffs at the same time so forgive this beginner ! RE: Python bot for whatsapp spamming. (getting error) - silenceMeNow - Sep 12, 2018 SyntaxError: Failed to execute 'evaluate' on 'Document': The string '//span@title = "shyam"]' is not a valid XPath expression. HMMMMMMM?? Maybe you should start reading your error messages. It literally stands there RE: Python bot for whatsapp spamming. (getting error) - rybk1a - Sep 12, 2018 You should try this (Notice the forward slash after span): Code user = driver.find_elements_by_xpath('//span/@title = "{}"]'.format(name))RE: Python bot for whatsapp spamming. (getting error) - kookur - Sep 12, 2018 (Sep 12, 2018 11:52 AM)rybk1a Wrote: You should try this (Notice the forward slash after span): Didn't worked ! RE: Python bot for whatsapp spamming. (getting error) - mikeyymooney - Sep 13, 2018 (Sep 12, 2018 06:52 PM)kookur Wrote: Didn't worked ! You are missing an opening bracket, try the following code below: Code user = driver.find_elements_by_xpath('//span[@title="{}"]'.format(name))Notice the extra "[" before @title. RE: Python bot for whatsapp spamming. (getting error) - kookur - Sep 13, 2018 (Sep 13, 2018 01:15 PM)mikeyymooney Wrote: You are missing an opening bracket, try the following code below: Not not worked. I was following this video : https://www.youtube.com/watch?v=5hr0IdVM7Qg RE: Python bot for whatsapp spamming. (getting error) - wtfrick - Sep 13, 2018 You should look into using requests instead of selenium. PM me your Discord if you need help. RE: Python bot for whatsapp spamming. (getting error) - kookur - Sep 13, 2018 (Sep 13, 2018 10:11 PM)wtfrick Wrote: You should look into using requests instead of selenium. Sent my discord. RE: Python bot for whatsapp spamming. (getting error) - mikeyymooney - Sep 14, 2018 (Sep 13, 2018 09:26 PM)kookur Wrote: Not not worked. I was following this video : That should work, I watched the video and his code is identical to the one I provided. Perhaps there is another issue with your code. RE: Python bot for whatsapp spamming. (getting error) - kookur - Sep 14, 2018 (Sep 14, 2018 06:47 AM)mikeyymooney Wrote: That should work, I watched the video and his code is identical to the one I provided. Perhaps there is another issue with your code. Can you post the exact complete code, So i can copy paste and check it. RE: Python bot for whatsapp spamming. (getting error) - mikeyymooney - Sep 14, 2018 (Sep 14, 2018 06:51 AM)kookur Wrote: Can you post the exact complete code, So i can copy paste and check it. Try this one from the Github page. Although it's last update was Nov 29, 2017. Code from selenium import webdriverRE: Python bot for whatsapp spamming. (getting error) - Mohinder - Sep 15, 2018 I made a few bots for WhatsApp. Im quite sure this one is working: Code driver.find_element(By.XPATH, '//*[@title="{}"]'.format(chat)).click()To use By, you need to import it into your script: Code from selenium.webdriver.common.by import ByThe code above will give you an exception when a user is not found, so you should catch that exception and handle it. Code try:And whenever an existing exception is used, import this into your script. For the above exception the import will be: Code from selenium.common.exceptions import NoSuchElementExceptionRE: Python bot for whatsapp spamming. (getting error) - Oblivious- - Sep 15, 2018 if you still haven't figured this out send me a private message I'll be glad to help RE: Python bot for whatsapp spamming. (getting error) - kookur - Sep 15, 2018 (Sep 15, 2018 08:08 AM)Oblivious- Wrote: if you still haven't figured this out send me a private message I'll be glad to help Mohinder helped me, bot is working fine now mate but if you don't mind i'd still like to add you somewhere and will learn something from you :) |