瑞星个人防火墙网址-etardas.com

google seo -> telegram: @ehseo6

">Newsnet 2022-09-28 18:16
  • home  >   /庾澄庆疑再当爸 55岁哈林与娇妻造人成功   >   瑞星个人防火墙网址
  • 连锁加盟的网址是 注册消防工程师考试报名网址
    午夜播放器免费版 新一代富婆点出网址
    水果奶奶理想论坛网址 how about 瑞星个人防火墙网址?
    What's the 瑞星个人防火墙网址 phone number? What is 瑞星个人防火墙网址 contact information ?
    Online consultation 瑞星个人防火墙网址 The picture of the 瑞星个人防火墙网址
    瑞星个人防火墙网址of the video Is 瑞星个人防火墙网址 for real ?
    瑞星个人防火墙网址's website A map of 瑞星个人防火墙网址
    瑞星个人防火墙网址 of tiktok 瑞星个人防火墙网址music
    瑞星个人防火墙网址 of news 瑞星个人防火墙网址app
    瑞星个人防火墙网址company Customer service of 瑞星个人防火墙网址 company

    教科书上黄网网址『网址:ff00.co』军事网址大全下载,百度新浪短网址生成器,神马影院午夜快播下载-F2F4Y5L8-2022-09-28 18:16

    顶红网app『网址:ff00.co』午夜福利线路一,阿森纳官网app,原网址JJJ85改成什么了-F2F4Y5L8-2022-09-28 18:16

    当前位置:首页?>?SEO工具?>?当前文章

    SEO工具

    求一个好网址你懂得『网址:ff00.co』韩版理论午夜视频,彩票网址大全2356,午夜说亮话的宠物-F2F4Y5L8-2022-09-28 18:16

    2022-09-28 117赞 老董笔记

      一批帖子需要回复,一堆账号等着去完成回复。手动登录回帖非常人所能忍受,脚本祝人一臂之力。selenium百度贴吧多贴多账号回复脚本如下:

      注意

      1、回帖按钮用的js提交,如果发布过程出现输入验证码,会提示回复成功但实际上未发布上去。

      2、回帖比较比较特别,元素加载完毕,下拉到底部必须等待一段时间,否则回复不上去;而发帖则不需等待,只要加载完直接发即可!

      功能:多账号多贴子回复,默认60-70秒回复1次,每个账号依次回复多个帖子。

      1、准备cookie_zh.txt,一行一个cookie

      2、准备tie_urls.txt,一行一个帖子网址()

      3、准备content.txt ,一行一个回复的句子,每次随机1个回复。

    # -*- coding: utf-8 -*-
    """
    注意:
    用的js提交,如果发布过程出现输入验证码,会提示回复成功但实际上未发布上去)
    下拉到底部必须等待,否则回复不上去
    功能:多账号多贴子回复,每个账号回复多条贴子
    默认60-70秒回复1次
    准备cookie_zh.txt一行一个cookie
    准备tie_urls.txt,一行一个帖子网址
    准备content.txt 一行一个回复的句子,随机1个回复
    """
    
    from pyquery import PyQuery as pq
    import threading
    import queue
    import time
    from urllib.parse import urlparse
    from openpyxl import load_workbook
    from openpyxl import Workbook
    import time
    import gc
    import json
    from selenium import webdriver
    from selenium.webdriver.common.by import By
    from selenium.webdriver.support.ui import WebDriverWait
    from selenium.webdriver.support import expected_conditions as EC
    from selenium.webdriver.chrome.options import Options
    import random
    from selenium.webdriver.common.action_chains import ActionChains
    from pykeyboard import PyKeyboard
    
    
    def get_driver(chromedriver_path,chrome_path,ua):
        ua = ua
        option = Options()
        option.binary_location = chrome_path
        option.add_argument("user-agent=" + ua)
        option.add_argument("--no-sandbox")
        option.add_argument("--disable-dev-shm-usage")
        option.add_argument("--disable-gpu")
        option.add_argument("--disable-features=NetworkService")
        option.add_argument("--disable-features=VizDisplayCompositor")
        # option.add_argument('headless')
        option.add_argument('log-level=3')  # 屏蔽日志
        option.add_argument('--ignore-certificate-errors-spki-list')  # 屏蔽ssl error
        option.add_argument('-ignore -ssl-errors')  # 屏蔽ssl error
        option.add_experimental_option("excludeSwitches", ["enable-automation"])
        option.add_experimental_option('useAutomationExtension', False)
        No_Image_loading = {"profile.managed_default_content_settings.images": 1}
        option.add_experimental_option("prefs", No_Image_loading)
        # 屏蔽webdriver特征
        option.add_argument("--disable-blink-features")
        option.add_argument("--disable-blink-features=AutomationControlled")
        driver = webdriver.Chrome(options=option, chrome_options=option,executable_path=chromedriver_path)
        return driver
    
    
    # 获得所有账号cookie
    def get_cookie(filepath):
        cookie_list = []
        cookie_list = [line.strip() for line in open(filepath,'r',encoding='utf-8')]
        return cookie_list
    
    
    # 字符串cookie转为字典
    def to_dict(cookie_str):
        cookie = {}
        lists = cookie_str.split(';')
        for i in lists:
            j = i.strip()
            j = j.split('=')
            cookie[j[0]] = j[1]
        return cookie
    
    
    # 自动登录
    def auto_login(cookie_dict):
        num = user_name = 0
        teiba_index = 'https://tieba.baidu.com/'
        driver.get(teiba_index)
        driver.delete_all_cookies()
        for k, v in cookie_dict.items():
            driver.add_cookie({'name': k, 'value': v})
        try:
            driver.get(teiba_index)  # 带cookie访问
            # 右侧导航加载
            navs = WebDriverWait(driver, 30).until(
                EC.visibility_of_element_located((By.ID, "com_userbar"))
            )
            li_list = driver.find_elements_by_css_selector('#com_userbar > ul >li')
            li_classnames = [li.get_attribute('class') for li in li_list]
            if 'u_username' in li_classnames:
                num = 1
                user = WebDriverWait(driver, 30).until(
                    EC.visibility_of_element_located(
                        (By.CSS_SELECTOR, "#j_u_username > div.u_menu_item.u_menu_username > a > span"))
                )
                user_name = user.text
        except Exception as e:
            print('登陆过程异常',e)
        else:
            pass
        finally:
            return num,user_name
    
    
    def huifu(tie_url,content):
        try:
            driver.get(tie_url)
            # 人为滚动一下
            driver.execute_script(js)
            # 加载关注按钮
            guanzhu = WebDriverWait(driver, 30).until(
                EC.visibility_of_element_located((By.ID, "j_head_focus_btn"))
            )
            # 鼠标移动到关注按钮
            ActionChains(driver).move_to_element(guanzhu).perform()
            # 输入框加载
            input_content = WebDriverWait(driver, 30).until(EC.element_to_be_clickable((By.ID, "ueditor_replace")))
            # 提交按钮加载
            button = WebDriverWait(driver, 30).until(EC.element_to_be_clickable((By.ID, "ueditor_replace")))
            huifu_first = WebDriverWait(driver, 30).until(EC.element_to_be_clickable((By.CLASS_NAME, "p_reply_first")))
            # 鼠标移动
            ActionChains(driver).move_to_element(guanzhu).move_to_element(huifu_first).perform()
            huifu_first.click()
            # 判断到了页面底部
            while True:
                js_to_bottom = 'var height = document.documentElement.scrollHeight-document.documentElement.scrollTop-document.documentElement.clientHeight;return(height)'
                to_bottom = driver.execute_script(js_to_bottom)
                # print(to_bottom)
                if int(to_bottom) == 0:
                    break
            print('页面到达底部,需额外等10s')
            # 鼠标点击进贴吧内容框
            js_content_position = "document.getElementById('ueditor_replace').click();"
            driver.execute_script(js_content_position)
            js_content = """document.getElementById('ueditor_replace').innerText='{0}'""".format(content)
            driver.execute_script(js_content)
            time.sleep(10)
            # button.click()
            # 用js方式提交 出现弹窗不会影响提交
            button_js = 'document.querySelector("#tb_rich_poster > div.poster_body.editor_wrapper > div.poster_component.editor_bottom_panel.clearfix > div > a").click()'
            driver.execute_script(button_js)
        except Exception as e:
            print(e,'回复异常')
        else:
            return 1
    
    
    def main(tie_urls,contents,cookie_list,time1,time2):
        for cookie in cookie_list:
            try:
                cookie_dict = to_dict(cookie)
                num_auto,user_name = auto_login(cookie_dict) # 自动登录
                if num_auto == 1:
                    print(user_name,'自动登录成功')
                else:
                    print('自动登录失败')
                    continue
            except Exception as e:
                print(e, '未顺利登录')
            else:
                for tie in tie_urls:
                    content = random.choice(contents)
                    num = huifu(tie,content)
                    if num == 1:
                        print(tie,'--回复成功')
                    else:
                        print(tie,'--回复失败')
                    time.sleep(random.randint(time1,time2))
            finally:
                    time.sleep(random.randint(time1,time2))
                    driver.delete_all_cookies()
    
    
    if __name__ == "__main__":
        f = open('tieba_huifu_fail.txt','a',encoding='utf-8')
        js = 'window.scrollBy(0,{0})'.format('document.body.scrollHeight')
        chromedriver_path = 'D:/python3/install/chromedriver.exe'
        chrome_path = 'C:/Program Files (x86)/Google/Chrome/Application/chrome.exe'
        ua = 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.125 Safari/537.36'
        # 全局变量
        driver = get_driver(chromedriver_path,chrome_path,ua)
        # cookie账号路径
        cookie_path = './cookie_zh.txt'
        cookie_list = get_cookie(cookie_path)
        # 回复内容
        contents = [i.strip() for i in open('./content.txt','r',encoding='utf-8')]
        # 要回复的贴
        tie_urls = [i.strip() for i in open('./tie_urls.txt', 'r', encoding='utf-8')]
        # 登陆间隔时间最小and最大
        sleep_min, sleep_max = 60, 70
        main(tie_urls,contents,cookie_list,sleep_min,sleep_max)
        driver.quit()
    

    文章评论

    selenium贴吧回复(多账号多吧)文章写得不错,值得赞赏
    • 个人微信扫码

      工作时间

      周一至周日 9:00-21:00

    • 如果你觉得本站很棒,可以通过扫码支付打赏哦!

      • 微信收款码
      • 支付宝收款码
    北京快乐8最长遗漏 8号彩累快三三分彩计划软件手机版 甘肃福彩快三每天开奖多少期 北京快三区间路线 一定牛双色球18006
    甘肃快三今天全部奖号 pc蛋蛋预测源码 极速快三最高多少倍 北京快乐8哪里开奖最快 201824号内蒙古快三开奖结果直播
    丹麦28pc蛋蛋预测软件 排列五机选号码机选器 双色球16135期点位组合 三分快3网上彩票 福彩3d阿福字谜
    体彩5码遗漏 广东福彩发行 pc蛋蛋开奖正规吗 pc蛋蛋官网开奖号码 彩票预测软件