Skip to content

Instantly share code, notes, and snippets.

View khodjaevsh's full-sized avatar

Shukhrat Khodjaev khodjaevsh

View GitHub Profile
import pandas as pd
from bs4 import BeautifulSoup
import requests
from time import sleep
import datetime
def clean_string(column):
return column.apply(lambda x: x.replace("\n",'',2)).apply(lambda x: x.replace(' ',''))
def scrape_reviews(PATH, n_pages, sleep_time = 0.3):
@khodjaevsh
khodjaevsh / Scraping customer reviews
Last active August 16, 2018 15:59
Customer Survey
def clean_string(column):
return column.apply(lambda x: x.replace("\n",'',2)).apply(lambda x: x.replace(' ',''))
def scrape_reviews(PATH, n_pages, sleep_time = 0.3):
names = []
ratings = []
headers = []
reviews = []