python登录网页版微信发送消息
生活随笔
收集整理的這篇文章主要介紹了
python登录网页版微信发送消息
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
# coding=utf-8
import datetime
import time
from selenium import webdriverurl = "https://wx2.qq.com/?&lang=zh_CN"browser = webdriver.Chrome()
browser.get("https://wx2.qq.com/?&lang=zh_CN")time.sleep(13)search = browser.find_element_by_xpath('//*[@id="search_bar"]/input')
print('這是點擊微信')
search.send_keys('微信昵稱')
time.sleep(3)
item = browser.find_element_by_xpath('//*[@id="mmpop1"]/div/div[1]/div/div[3]/div/div/div[2]/h4')
item.click()for i in range(200):textarea = browser.find_element_by_xpath('//*[@id="editArea"]')textarea.send_keys("服不服")submit = browser.find_element_by_xpath('//*[@id="chatArea"]/div[3]/div[3]/a')submit.click()#time.sleep(1)
textarea.send_keys("以后還和不和我刷屏了")submit = browser.find_element_by_xpath('//*[@id="chatArea"]/div[3]/div[3]/a')submit.click()time.sleep(1)time.sleep(55)
browser.quit()
?
轉(zhuǎn)載于:https://www.cnblogs.com/jiyanjiao-702521/p/10391390.html
《新程序員》:云原生和全面數(shù)字化實踐50位技術(shù)專家共同創(chuàng)作,文字、視頻、音頻交互閱讀總結(jié)
以上是生活随笔為你收集整理的python登录网页版微信发送消息的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 迭代器和生成器的区别
- 下一篇: python之time模块和hashli