mirror of
https://gitlab.com/jeancf/twoot.git
synced 2025-03-27 07:56:48 +00:00
Removed debug print
This commit is contained in:
parent
a5fde58615
commit
6a397cc089
20
twoot.py
20
twoot.py
@ -169,9 +169,9 @@ def main(argv):
|
|||||||
'The twitter page did not download correctly. Aborting'
|
'The twitter page did not download correctly. Aborting'
|
||||||
|
|
||||||
# DEBUG: Save page to file
|
# DEBUG: Save page to file
|
||||||
of = open('no_js_page.html', 'w')
|
#of = open('no_js_page.html', 'w')
|
||||||
of.write(no_js_page.text)
|
#of.write(no_js_page.text)
|
||||||
of.close()
|
#of.close()
|
||||||
|
|
||||||
# Verify that this is the no_js page that we expected
|
# Verify that this is the no_js page that we expected
|
||||||
soup = BeautifulSoup(no_js_page.text, 'html.parser')
|
soup = BeautifulSoup(no_js_page.text, 'html.parser')
|
||||||
@ -193,9 +193,9 @@ def main(argv):
|
|||||||
'The twitter page did not download correctly. Aborting'
|
'The twitter page did not download correctly. Aborting'
|
||||||
|
|
||||||
# DEBUG: Save page to file
|
# DEBUG: Save page to file
|
||||||
of = open(twit_account + '.html', 'w')
|
#of = open(twit_account + '.html', 'w')
|
||||||
of.write(twit_account_page.text)
|
#of.write(twit_account_page.text)
|
||||||
of.close()
|
#of.close()
|
||||||
|
|
||||||
# Make soup
|
# Make soup
|
||||||
soup = BeautifulSoup(twit_account_page.text, 'html.parser')
|
soup = BeautifulSoup(twit_account_page.text, 'html.parser')
|
||||||
@ -224,9 +224,9 @@ def main(argv):
|
|||||||
'The twitter page did not download correctly. Aborting'
|
'The twitter page did not download correctly. Aborting'
|
||||||
|
|
||||||
# DEBUG: Save page to file
|
# DEBUG: Save page to file
|
||||||
of = open('full_status_page.html', 'w')
|
#of = open('full_status_page.html', 'w')
|
||||||
of.write(full_status_page.text)
|
#of.write(full_status_page.text)
|
||||||
of.close()
|
#of.close()
|
||||||
|
|
||||||
# Make soup
|
# Make soup
|
||||||
soup = BeautifulSoup(full_status_page.text, 'html.parser')
|
soup = BeautifulSoup(full_status_page.text, 'html.parser')
|
||||||
@ -269,8 +269,10 @@ def main(argv):
|
|||||||
|
|
||||||
photos = [] # The no_js version of twitter only shows one photo
|
photos = [] # The no_js version of twitter only shows one photo
|
||||||
|
|
||||||
|
# Check if there are photos attached
|
||||||
media = tmt.find('div', class_='media')
|
media = tmt.find('div', class_='media')
|
||||||
if media:
|
if media:
|
||||||
|
# Extract photo url and add it to list
|
||||||
pic = str(media.img['src']).strip(':small')
|
pic = str(media.img['src']).strip(':small')
|
||||||
photos.append(pic)
|
photos.append(pic)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user