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 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…