Merge pull request #84 from getPoland/patch-1

Fixed the xpath
This commit is contained in:
Sameer Bhatt (debugger) 2021-11-06 11:15:46 +05:30 committed by GitHub
commit 04a9cfc45b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,8 @@
from selenium import webdriver
import os
from webdriver_manager.chrome import ChromeDriverManager #1st changer
from webdriver_manager.chrome import ChromeDriverManager # 1st changer
def banner():
print('''
## ## ======= #### #### #### =======
@ -9,8 +11,10 @@ def banner():
\ \/ / \ \/ / # # ## ## / / #### \ \ # #
#### #### ======= #### ## ## =======
''')
def main():
driver = webdriver.Chrome(ChromeDriverManager().install()) #2nd change
driver = webdriver.Chrome(ChromeDriverManager().install()) # 2nd change
driver.get('https://web.whatsapp.com/')
name = input('Enter the name of user or group: ')
@ -23,14 +27,15 @@ def main():
user.click()
# The classname of message box may vary.
msg_box = driver.find_element_by_xpath('//*[@id="main"]/footer/div[1]/div[2]/div/div[2]')
msg_box = driver.find_element_by_xpath('/html/body/div[1]/div[1]/div[1]/div[4]/div[1]/footer/div[1]/div/div/div[2]/div[1]/div/div[2]')
for i in range(count):
msg_box.send_keys(msg)
# The classname of send button may vary.
button = driver.find_element_by_xpath('//*[@id="main"]/footer/div[1]/div[3]/button')
button = driver.find_element_by_xpath('/html/body/div[1]/div[1]/div[1]/div[4]/div[1]/footer/div[1]/div/div/div[2]/div[2]/button')
button.click()
print('Bombing Complete!!')
banner()
main()