Skip to content

Instantly share code, notes, and snippets.

@harshanas
harshanas / gist:8a15d29c155a0ad1c7be22722e04798b
Last active May 24, 2020 04:51
Setting up Selenium Environment in Heroku
@harshanas
harshanas / VariousPythonCodes.md
Created August 27, 2019 05:01
Various Python code snippets that can be useful in day to day work

Get Now Date Time

import datetime
datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
@harshanas
harshanas / PythonBeautifulSoup.md
Last active August 28, 2019 17:14
BeautifulSoup Code Snippets

Basic Imports, Loading Page and Parsing it to BS

from bs4 import BeautifulSoup
import urllib.request

page = urllib.request.urlopen("https://google.com/").read()
soup = BeautifulSoup(page, 'html.parser')  # Uses html.parser to parse the page

Working with Elements

@harshanas
harshanas / FlaskApache.md
Last active September 5, 2017 08:24
Deploy Flask App to apache in Ubuntu 16.04

Deploy Flask App to apache in Ubuntu 16.04

  1. Make New Directory in var/www/ mkdir bots
  2. Create FILENAME.wsgi file sudo nano bots.wsgi
  3. Add this content and Save File
    #! /usr/bin/python3
    import sys