618上百家店铺实时数据更新-生意参谋为例

经过测试可实现上百家店铺实时数据更新可行性方案二:

第一步:谷歌浏览器多开,将每个店铺保持登录状态不关闭,可代码建立

def create_shortcut(shipid):

target_path = r'"C:\Users\miiow\AppData\Local\Google\Chrome\Application\chrome.exe"' # 要创建快捷方式的文件路径

shortcut_name = shipid # 快捷方式的名称

shortcut_dir = r"D:\浏览器" # 快捷方式的目录

Arguments = r'--user-data-dir=D:\浏览器\{}'.format(shipid) # 添加属性值

shell = win32com.client.Dispatch("WScript.Shell")

shortcut = shell.CreateShortCut(os.path.join(shortcut_dir, f"{shortcut_name}.lnk"))

shortcut.TargetPath = target_path

shortcut.Arguments = Arguments

shortcut.WorkingDirectory = os.path.dirname(target_path)

shortcut.save()

# create_shortcut(352985466)

import shutil

import os

def copy_and_rename_folder(shopid):

folder_path = r"D:\浏览器\{}".format(shopid)

if not os.path.exists(folder_path):

# 示例

# source_folder = r"C:\Users\miiow\AppData\Local\Google\Chrome\User Data" # 源文件夹路径

source_folder = r"D:\浏览器\485664372" # 源文件夹路径

destination_folder = r"D:\浏览器\789_folder" # 目标文件夹路径

new_name = shopid # 新的文件夹名

# 复制文件夹

if not os.path.exists(destination_folder):

shutil.copytree(source_folder, destination_folder)

# 重命名文件夹

os.rename(destination_folder, os.path.join(os.path.dirname(destination_folder), new_name))

或者直接在谷歌快捷键属性值设置

read-normal-img

第二步:让页面自己刷新用攻克实时监听,攻克配置时选择更新模式,就可以写进最新的数据,删除旧数据

read-normal-img

read-normal-img

测试开了两个浏览器

read-normal-img

本文禁止转载或摘编

  • 5
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值