This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from bs4 import BeautifulSoup | |
search_keyword = input("Write a keyword to search on Amazon: ") | |
search_format = search_keyword.strip().replace(' ', '+') | |
make_url = 'https://www.amazon.com/s?k=' + search_format | |
print(make_url) | |
headers = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.93 Safari/537.36", "Referer": "https://www.amazon.com/"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import openai | |
import random | |
def random_number(): | |
number = random.randint(2, 4) | |
return number | |
def get_answer(question): |