mirror of
https://github.com/timberjoegithub/GoogleScrape.git
synced 2026-07-22 00:19:48 +00:00
linting
This commit is contained in:
@@ -596,7 +596,7 @@ def get_google_data(driver, local_outputs):
|
|||||||
# switch to selected iframe
|
# switch to selected iframe
|
||||||
driver.switch_to.frame(iframe)
|
driver.switch_to.frame(iframe)
|
||||||
# Now find button and click on button
|
# Now find button and click on button
|
||||||
video_elements = driver.find_elements(By.XPATH ,'//video') #.get_attribute('src')
|
video_elements = driver.find_elements(By.XPATH ,'//video')#.get_attribute('src')
|
||||||
urlmedia = str((video_elements[0]).get_attribute("src"))
|
urlmedia = str((video_elements[0]).get_attribute("src"))
|
||||||
current_url = video_elements[0]._parent.current_url
|
current_url = video_elements[0]._parent.current_url
|
||||||
# return back away from iframe
|
# return back away from iframe
|
||||||
@@ -795,8 +795,8 @@ def write_to_database(data, local_outputs):
|
|||||||
# 'dictPostComplete':str(processrow[8])}
|
# 'dictPostComplete':str(processrow[8])}
|
||||||
# if env.forcegoogleupdate:
|
# if env.forcegoogleupdate:
|
||||||
# print (' Row ',processrow[0],' updated in database due to forcegoogleupdate')
|
# print (' Row ',processrow[0],' updated in database due to forcegoogleupdate')
|
||||||
# local_outputs['postssession'].query(Posts).filter(Posts.name == processrow[0]).update\
|
# local_outputs['postssession'].query(Posts).filter(Posts.name == processrow[0]).\
|
||||||
# (d2_dict)
|
# update (d2_dict)
|
||||||
# local_outputs['postssession'].commit()
|
# local_outputs['postssession'].commit()
|
||||||
# elif processrow[0] is not None:
|
# elif processrow[0] is not None:
|
||||||
# # Create a Python dictionary object with all the column values
|
# # Create a Python dictionary object with all the column values
|
||||||
@@ -989,8 +989,10 @@ def check_wordpress_post(postname, postdate, headers2,local_outputs):
|
|||||||
print ('Could not query for post on wordpress: ', postname,postdate, type(error))
|
print ('Could not query for post on wordpress: ', postname,postdate, type(error))
|
||||||
return False, False
|
return False, False
|
||||||
# try:
|
# try:
|
||||||
# newdate,newdate2,visitdate = get_wordpress_post_date_string(result[0]['date'],result[0]['date'])
|
# newdate,newdate2,visitdate = get_wordpress_post_date_string(result[0]['date'],\
|
||||||
# newdate3,newdate4,visitdate2 = get_wordpress_post_date_string(postdate,str(datetime.now()))
|
# result[0]['date'])
|
||||||
|
# newdate3,newdate4,visitdate2 = get_wordpress_post_date_string(postdate,\
|
||||||
|
# str(datetime.now()))
|
||||||
# if visitdate and visitdate2:
|
# if visitdate and visitdate2:
|
||||||
# print ('Post exists, checking visit date')
|
# print ('Post exists, checking visit date')
|
||||||
# except KeyError as error:
|
# except KeyError as error:
|
||||||
@@ -1447,8 +1449,8 @@ def post_to_tiktok(title, content, headers2, date, rating, address, picslist, lo
|
|||||||
'X-SS-TOKEN': env.tiktok_app_id, #[Your App ID],
|
'X-SS-TOKEN': env.tiktok_app_id, #[Your App ID],
|
||||||
'X-TikTok-Signature': env.tiktok_client_secret, #[Your App Secret]
|
'X-TikTok-Signature': env.tiktok_client_secret, #[Your App Secret]
|
||||||
}
|
}
|
||||||
connect_response = requests.post('https://open.tiktokapis.com/v2/post/publish/video/init/',headers=connect_json_header,\
|
connect_response = requests.post('https://open.tiktokapis.com/v2/post/publish/video/init/',\
|
||||||
data=connect_json_body,timeout=env.request_timeout)
|
headers=connect_json_header,data=connect_json_body,timeout=env.request_timeout)
|
||||||
|
|
||||||
#request https://api.tiktok.com/open-api/v2/aweme/post/?aweme-type=video
|
#request https://api.tiktok.com/open-api/v2/aweme/post/?aweme-type=video
|
||||||
# https://api.tiktok.com/open-api/v2/aweme/post/
|
# https://api.tiktok.com/open-api/v2/aweme/post/
|
||||||
|
|||||||
Reference in New Issue
Block a user