I am new to python and was trying to do a web scraping project. I was referring to a code on github - main.py When I run the code I get this error. I tried to check spaces and tabs but I could not fix it. Can someone help me!
File "main.py", line 158 <<<<<<< HEAD ^IndentationError: expected an indented block
def scrape_status(review):
try:
res = author.text.split('-')[0]
except Exception:
logger.warning('Failed to scrape employee_status')
res = np.nan
return res
def scrape_rev_title(review):
return review.find_element_by_class_name('summary').text.strip('"')
def scrape_years(review):
<<<<<<< HEAD
try:
first_par = review.find_element_by_class_name(
'reviewBodyCell').find_element_by_tag_name('p')
if '(' in first_par.text:
res = first_par.text[first_par.text.find('(') + 1:-1]
else:
res = np.nan
except Exception:
=======
first_par = review.find_element_by_class_name(
'reviewBodyCell').find_element_by_tag_name('p')
if '(' in first_par.text:
res = first_par.text[first_par.text.find('(') + 1:-1]
else:
>>>>>>> 7a5082d8ae61d93721d9ec8deb4ddda3d21cfb47
res = np.nan
return res
def scrape_helpful(review):
try:
<<<<<<< HEAD
#helpful = review.find_element_by_class_name('count')
helpful = review.find_element_by_class_name('voteHelpful').find_element_by_class_name('count').find_element_by_tag_name('span')
=======
helpful = review.find_element_by_class_name('helpfulCount')
>>>>>>> 7a5082d8ae61d93721d9ec8deb4ddda3d21cfb47
res = helpful[helpful.find('(') + 1: -1]
except Exception:
res = 0
return res
def expand_show_more(section):
try:
more_content = section.find_element_by_class_name('moreContent')
more_link = more_content.find_element_by_class_name('moreLink')
more_link.click()
except Exception:
pass