mirror of
https://github.com/bhattsameer/Bombers.git
synced 2023-08-10 21:12:53 +03:00
Fixed the xpath
Fixed the xpath of message.box & button.send
This commit is contained in:
parent
8d735c5002
commit
1bddda2212
9
wbomb.py
9
wbomb.py
@ -1,6 +1,8 @@
|
|||||||
from selenium import webdriver
|
from selenium import webdriver
|
||||||
import os
|
import os
|
||||||
from webdriver_manager.chrome import ChromeDriverManager # 1st changer
|
from webdriver_manager.chrome import ChromeDriverManager # 1st changer
|
||||||
|
|
||||||
|
|
||||||
def banner():
|
def banner():
|
||||||
print('''
|
print('''
|
||||||
## ## ======= #### #### #### =======
|
## ## ======= #### #### #### =======
|
||||||
@ -9,6 +11,8 @@ def banner():
|
|||||||
\ \/ / \ \/ / # # ## ## / / #### \ \ # #
|
\ \/ / \ \/ / # # ## ## / / #### \ \ # #
|
||||||
#### #### ======= #### ## ## =======
|
#### #### ======= #### ## ## =======
|
||||||
''')
|
''')
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
driver = webdriver.Chrome(ChromeDriverManager().install()) # 2nd change
|
driver = webdriver.Chrome(ChromeDriverManager().install()) # 2nd change
|
||||||
driver.get('https://web.whatsapp.com/')
|
driver.get('https://web.whatsapp.com/')
|
||||||
@ -23,14 +27,15 @@ def main():
|
|||||||
user.click()
|
user.click()
|
||||||
|
|
||||||
# The classname of message box may vary.
|
# 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):
|
for i in range(count):
|
||||||
msg_box.send_keys(msg)
|
msg_box.send_keys(msg)
|
||||||
# The classname of send button may vary.
|
# 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()
|
button.click()
|
||||||
print('Bombing Complete!!')
|
print('Bombing Complete!!')
|
||||||
|
|
||||||
|
|
||||||
banner()
|
banner()
|
||||||
main()
|
main()
|
Loading…
Reference in New Issue
Block a user