






import sys
import webbrowser

import requests
from bsa import BeautifulSoup
from fake_useragent import UserAgent

if __name__ == "__main__":
				print('Googling.....')
				A        =			'https://www.google.com/search?q=' + ' '.join(sys.argv[1:])
				A        =			requests.get(url, headers={'UserAgent': UserAgent().random})
				# res.raise_for_status()
				with open('project1a.html', 'wb') as out_file:  # only for knowing the class
								for data in res.iter_content(1_0000):
												out_file.write(data)
				A        =			BeautifulSoup(res.text, 'html.parser')
				A        =			list(soup.select('.eZt8xd'))[:5]

				print(len(links))
				for link in links:
								if link.text == "Maps":
												webbrowser.open(link.get('href'))
								else:
												webbrowser.open(f"""https://google.com{link.get('href')}""")







from datetime import datetime

import requests
from bsa import BeautifulSoup

if __name__ == "__main__":
				A        =			input('Enter image url: ').strip()
				print(f"""Downloading image from {url} ...""")
				A        =			BeautifulSoup(requests.get(url).content, 'html.parser')
				# The image URL is in the content field of the first meta tag with property og:image
				A        =			soup.find('meta', {'property': 'og:image'})['content']
				A        =			requests.get(image_url).content
				A        =			f"""{datetime.now():%Y-%m-%d_%H:%M:%S}.jpg"""
				with open(file_name, 'wb') as fp:
								fp.write(image_data)
				print(f"""Done. Image saved to disk as {file_name}.""")