Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Bing image scrape method for ch.py bots
- #Using Python 3.4
- #By Hardware
- elif used_prefix and cmd == "bing":
- images = []
- new = []
- if not args: return room.message("You need a search keyword..")
- url = requests.get("https://www.bing.com/images/search?q="+args)
- soup = BeautifulSoup(url.content, "html.parser")
- for img in soup.findAll('img'):
- images.append(img.get('src'))
- for i in images[2:]:
- if (".jpg" or ".png" or "gif") in str(i):
- new.append(i)
- else: new.append(str(i).replace("=1.1", "=1.1.jpg"))
- room.message("\r \r \r"+"\r".join(new[0:3]))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement