Skip to content

Instantly share code, notes, and snippets.

View RajeshKrSahoo's full-sized avatar
🎯
Focusing

Rajesh Kumar Sahoo RajeshKrSahoo

🎯
Focusing
View GitHub Profile
from selenium import webdriver
import time
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.service import Service
service = Service(executable_path=r"C:\Users\VT151UP\OneDrive - EY\Documents\chromedriver.exe")
options = webdriver.ChromeOptions()
@RajeshKrSahoo
RajeshKrSahoo / printFibRow.py
Created September 30, 2021 01:34
print fiboncaii base on row number input
##Python program to print fibonacci base on row number
from functools import lru_cache
@lru_cache(maxsize=1000)
def fibonacci(n):
if n==0:
return 0
if n==1:
##With Naukri data
#### Used selenium as direct request module was not able to get the HTML element so Selenium helped to achieve so
from selenium import webdriver
from bs4 import BeautifulSoup
import time
import pandas as pd
from selenium.webdriver.chrome.options import Options
header = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36",
@RajeshKrSahoo
RajeshKrSahoo / createLog.txt
Last active December 1, 2020 13:38
logger code
class createLog:
def formatLog(filename):
import os, logging
logfilename = os.path.join(os.path.expanduser('~'), 'xyz', '{0}.log'.format(filename))
print('Log file path : Home/xyz/{}'.format(logfilename))
# create logger
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
# create console handler and set level to debug
'''
Below code downlaod all the videos in the playlists present
'''
import re,os
from pytube import Playlist,YouTube
# YOUTUBE_STREAM_AUDIO = '480' # modify the value to download a different stream
DOWNLOAD_DIR = os.getcwd()+'newDownload'
table {
border: 3.5px solid black;
border-collapse: collapse;
}
th,
td {
{% extends "layout.html" %}
{% block info %}
<h2>{{ title|safe }}</h2>
{{ posts|safe }}
{% endblock %}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
import pandas as pd
import numpy as np
import requests
from bs4 import BeautifulSoup as bs
from datetime import datetime
def scrap_coronaData():
# from werkzeug.wrappers import Request, Response # for running Flask on Jupyter Lab
from flask import Flask, jsonify,redirect, request, render_template, url_for, Markup
from coronaScrap import *
from multiprocessing import Value #This is Multithreading lib
counter = Value('i', 0)
app = Flask(__name__)