Fixed 'On Tour' section breaking like count

This commit is contained in:
Thomas Wade 2018-09-29 15:24:45 +09:30
parent 3a2f5d1932
commit a2fdec3e27

View File

@ -34,6 +34,7 @@ USER_MAX_FOLLOWERS = 25
import time
import shelve
import re
import networkx as nx
from selenium import webdriver
from selenium.webdriver.common.by import By
@ -137,7 +138,7 @@ def Get_Basic_Info(user):
print(' Followers: ' + str(user.follower_count))
# Grab their like count
like_count_elem = soup.find(class_='sidebarHeader__actualTitle')
like_count_elem = soup.find(class_='sidebarHeader__actualTitle', text=re.compile(r'^[\S]*?\ likes$'))
if like_count_elem:
user.like_count = Human_Str_To_Int(str(like_count_elem.string.split(' ')[0]))
print(' Likes: ' + str(user.like_count))