Skip to content

Instantly share code, notes, and snippets.

View KaushikShresth07's full-sized avatar

Kaushik Shresth KaushikShresth07

View GitHub Profile
'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.2 (KHTML, like Gecko) Chrome/22.0.1216.0 Safari/537.2'
# Import necessary packages
from time import sleep
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
import warnings
from selenium.webdriver.chrome.service import Service
# Ignore unnecessary warnings
warnings.simplefilter("ignore")
import pyperclip
import pyautogui
import webbrowser
from time import sleep
import json
import keyboard
def CookieScrapper():
webbrowser.open("https://bard.google.com")
sleep(2)
# Text Modification Function -
def split_and_save_paragraphs(data, filename):
paragraphs = data.split('\n\n')
with open(filename, 'w') as file:
file.write(data)
data = paragraphs[:2]
separator = ', '
joined_string = separator.join(data)
return joined_string
XPaths are Given Here :-
1 - /html/body/div[1]/div/div/main/article/div/div/div/div/div/div/div[2]/div/div/div[2]/div/textarea
2 - /html/body/div[1]/div/div/main/article/div/div/div/div/div/div/div[2]/div/div/div[2]/button/span
3 - /html/body/div[1]/div/div/main/article/div/div/div/div/div/div/div[2]/div/div/div[1]/div[{Data}]/span[2]
# Setting Up The Driver & Opening The Website :-
chrome_driver_path = 'chromedriver.exe'
chrome_options = Options()
from keyboard import press_and_release
from keyboard import press
import webbrowser as web
def WindowsAuto(command):
query = str(command)
if 'home screen' in query:
from geopy.distance import great_circle # pip install geopy
from geopy.geocoders import Nominatim # pip install geopy
import webbrowser # pip install webbrowser
import geocoder # pip install geocoder
import requests
def GoogleMaps(Place):
Url_Place = "https://www.google.com/maps/place/" + str(Place)
from pyautogui import click
from time import sleep
from keyboard import write
from keyboard import press
from os import startfile
def WhatsappMsg(name,message,Path):
startfile(str(Path))
import requests # pip install requests
import os
import matplotlib.pyplot as plt # pip install matplotlib
import cartopy.crs as ccrs # pip install cartopy
from PIL import Image # pip install PIL
def NasaNews(Date,Api_Key,pathNow,PathToSave):
Url = "https://api.nasa.gov/planetary/apod?api_key=" + str(Api_Key)
def Listen():
import speech_recognition as sr
r = sr.Recognizer()
with sr.Microphone() as source:
print(" ")