Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.5k views
in Technique[技术] by (71.8m points)

discord.py - Python Ebay bot viewer

I need help, I want to make a bot viewer for ebay, but I disagree. This consists in using the command "!print" + the ad link and after the bot will send the request to the website and so the ad will view I have most of the code, but I don't know how to use args, can anyone help me ???

import requests
import threading
import time
from discord.ext import commands
from threading import Thread


bot = commands.Bot(command_prefix='!')
       


def view(prodUrl, index, args):
    session = requests.Session()
    headers = {
        'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36',
        'Accept':'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8'
    }
    session.get(prodUrl, headers=headers)
    print("[SUCCESSFULLY VIEWED # " + str(index) + "]" )

def start(numView, productUrl, args):
    isDone = False
    while (isDone == False):
        for i in range(numView):
            t = Thread(target = view, args = (productUrl,i))
            t.start()
            time.sleep(0.1)
        isDone=True
        
def loopStart(numTimes, productUrl, args):
    for i in range(numTimes):
        view(productUrl)

@bot.command()
async def print(ctx, args):
    await ebayLink = args
    await start(100, ebayLink)````
question from:https://stackoverflow.com/questions/65909158/python-ebay-bot-viewer

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...