35 KiB
35 KiB
In [38]:
import selenium import time import datetime from selenium import webdriver from selenium.webdriver.common.desired_capabilities import DesiredCapabilities from bs4 import BeautifulSoup from IPython.display import display, Image, HTML from jupyter_progressbar import ProgressBar import json
In [36]:
driver = webdriver.Chrome() driver.get('https://www.kickstarter.com/projects/inspero/vinci-20-worlds-first-standalone-ai-sports-headpho/comments')
In [37]:
class get_comments_of_project: def __init__(self, driver): self.driver = driver val = driver.find_element_by_css_selector("[itemprop=Project\[comments_count\]]").get_attribute('data-value') self.total_comments = int(val) def __iter__(self): done = set() driver.execute_script("$('a.older_comments').click()") n_wait = 0 while driver.execute_script("return $('a.older_comments:visible').length") > 0: n_wait += 1 n_comments = driver.execute_script("return $('li.comment').length") if n_comments > 0 or n_wait > 5: driver.execute_script("$('a.older_comments').click()") for item in driver.find_elements_by_css_selector('li.comment .avatar.left a'): profile_id = item.get_attribute('href').split('/profile/')[1] driver.execute_script('$("#%s").remove()' % item.find_element_by_xpath('../../..').get_attribute('id')) yield profile_id n_wait = 0 time.sleep(0.5) def __len__(self): return self.total_comments for profile_id in ProgressBar(get_comments_of_project(driver)): print(profile_id)
Failed to display Jupyter Widget of type VBox
.
If you're reading this message in the Jupyter Notebook or JupyterLab Notebook, it may mean that the widgets JavaScript is still loading. If this message persists, it likely means that the widgets JavaScript library is either not installed or not enabled. See the Jupyter Widgets Documentation for setup instructions.
If you're reading this message in another frontend (for example, a static rendering on GitHub or NBViewer), it may mean that your frontend doesn't currently support widgets.
1833678544 839015508 458527266 2001994789 1217263212 889917255 395880877 395880877 794959240 794959240 794959240 794959240 794959240 794959240 794959240 794959240 495300557 495300557 205681801 643428 jamesvo66 1864830176 458527266 839015508 794959240 794959240 794959240 794959240 794959240 794959240 794959240 794959240 794959240 794959240 761485634 1608275255 1232829437 1232829437 688462716 1833678544 498306784 1923877728 1233568244 458527266 794959240 794959240 794959240 794959240 794959240 1561880636 1369960534 1882731028 796017561 611328595 794959240 794959240 794959240 944540369 1635607059 1810929003 794959240 794959240 794959240 794959240 794959240 794959240 794959240 794959240 794959240 794959240 794959240 794959240 794959240 794959240 796017561 1196724163 588920077 237902823 1511452974 nyhotdog 1751366140 1090197121 1479259025 1882731028 1036267918 1196506039 1849808531 1082496859 794959240 794959240 794959240 1668507980 1001248356 1699988054 794959240 794959240 794959240 794959240 794959240 794959240 1369960534 1882731028 796017561 611328595 794959240 794959240 794959240 944540369 1635607059 1810929003 794959240 794959240 794959240 794959240 794959240 794959240 794959240 794959240 794959240 794959240 794959240 794959240 794959240 794959240 796017561 1196724163 588920077 237902823 1511452974 nyhotdog 1751366140 1090197121 1479259025 1882731028 1036267918 1196506039 1849808531 1082496859 794959240 794959240 794959240 1668507980 1001248356 1699988054 794959240 794959240 794959240 794959240 794959240 794959240 518370125 595774491 1001248356 728253404 410446349 1862429352 794959240 794959240 794959240 1383084788 588920077 1383084788 794959240 794959240 794959240 1082496859 1018335009 2043281165 794959240 794959240 794959240 794959240 794959240 1695443028 1695443028 347211813 347211813 984721398 1864830176 794959240 794959240 794959240 794959240 794959240 1402676220 355097478 588920077 1342165126 1337628871 794959240 794959240 794959240 2044662041 9214568 1635607059 794959240 794959240 1997448604 794959240 794959240 794959240 794959240 370126996 1161261191 1699992933 334387016 2098214317 794959240 794959240 794959240 794959240 794959240 794959240 794959240 1018335009 665155733 1864830176 shivasiddharth shivasiddharth 458322083 azirius 1633004206 794959240 794959240 794959240 794959240 794959240 minari minari minari 479933865 shivasiddharth 794959240 794959240 794959240 794959240 665155733 1051575684 1736145611 384930616 794959240 794959240 794959240 794959240 794959240 673029263 796052291 329203707 1208694063 329203707 794959240 794959240 31153046 794959240 794959240 794959240 794959240 794959240 794959240 794959240 794959240 794959240 794959240 794959240 794959240 794959240 794959240 794959240 794959240 shivasiddharth 794959240 794959240 794959240 794959240 794959240 794959240 794959240 794959240 383123477 383123477 383123477 383123477 383123477 301690636 301690636 301690636 677180350 677180350 677180350 677180350 677180350 677180350 301690636 301690636 301690636 383123477 383123477 383123477 671121685 671121685 671121685 671121685 247626573 shivasiddharth 873037190 796017561 794959240 794959240 794959240 794959240 794959240 794959240 794959240 794959240 794959240 794959240 794959240 344091852 114788583 shivasiddharth 787017813 1018199754 jessslead 1024738362 1494317641 1214658227 1471890730 inspero jamesvo66 1208694063 1208694063 1957484080 794959240 794959240 794959240 794959240 794959240 1890562474 1208694063 1862429352 1979910459 972291987 794959240 794959240 794959240 794959240 794959240 794959240 794959240 366980299 shivasiddharth shivasiddharth 1930498551 212692344 1862429352 972291987 794959240 794959240 794959240 794959240 794959240 794959240 794959240 shivasiddharth shivasiddharth 334387016 728253404 1862429352 95691339 1862429352 1862429352 344091852 653537333 794959240 794959240 794959240 794959240 794959240 794959240 794959240 794959240 794959240 796017561 1494317641 518370125 518370125 1979910459 819120336 1979910459 728253404 jaiaravindj 794959240 794959240 276311303 794959240 794959240 794959240 1018335009 794959240 794959240 794959240 459875215 1614890600 518370125 1051575684 690276919 796017561 1077783542 794959240 794959240 794959240 75341017 75341017 796017561 1617342515 794959240 794959240 794959240 794959240 794959240 794959240 794959240 794959240 794959240 1337628871 878996580 518370125 1488592791 1000694536 639982179 1979910459 1635607059 2112136110 794959240 794959240 794959240 794959240 794959240 1184017324 1184017324 felixkim 2145345421 1233568244 1012380866 770423085 794959240 92748688 794959240 794959240 794959240 2044177248 907670727 1422458250 794959240 794959240 75341017 728253404 794959240 794959240 794959240 794959240 794959240 794959240 1494317641 1979910459 2011132359 2043908614 344091852 16380284 794959240 794959240 794959240 794959240 794959240 794959240 794959240 1494317641 jjl 643428 643428 971896604 344091852 1051575684 1614890600 794959240 794959240 794959240 643428 1614890600 794959240 794959240 794959240 794959240 794959240 794959240 1024738362 643428 1635607059 1729640748 728253404 728253404 1979910459 907670727 794959240 794959240 794959240 794959240 95691339 2043908614 2043908614 1942686605 794959240 inspero 271031935 1742579183 794959240 794959240 794959240 794959240 794959240 794959240 794959240 1882731028 301690636 383123477 383123477 383123477 383123477 677180350 677180350 671121685 671121685 671121685 334387016 philcassell 794959240 794959240 794959240 794959240 794959240 794959240 794959240 794959240 794959240 794959240 1024738362 796017561 1284830330 794959240 728253404 794959240 794959240 794959240 344091852 794959240 794959240 794959240 794959240 464629808 671121685 796017561 95691339 677180350 383123477 653537333 722648632 728253404 344091852 1635607059 301690636 301690636 728253404 794959240 794959240 794959240 794959240 794959240 794959240 794959240 794959240 794959240 794959240 794959240 794959240 794959240 1024738362 794959240 cassadee 1979910459 677180350 677180350 677180350 383123477 383123477 383123477 383123477 383123477 671121685 671121685 671121685 250887333 728253404 250887333 728253404 250887333 250887333 250887333 250887333 250887333 250887333 250887333 250887333 250887333 250887333 344091852 677180350 677180350 677180350 2044177248 301690636 301690636 677180350 677180350 677180350 383123477 383123477 383123477 383123477 671121685 671121685 671121685 794959240 794959240 671121685 671121685 794959240 671121685 794959240 794959240 794959240 873037190 794959240 794959240 794959240 794959240 794959240 794959240 301690636 301690636 250887333 794959240 794959240 383123477 383123477 794959240 383123477 250887333 250887333 250887333 250887333 1289035088 250887333 250887333 250887333 250887333 250887333 250887333 250887333 250887333 250887333 250887333 250887333 250887333 250887333 250887333 250887333 250887333 250887333 250887333 873037190 301690636 383123477 383123477 671121685 671121685 677180350 677180350 677180350 301690636 301690636 301690636 301690636 383123477 383123477 671121685 671121685 1289035088 671121685 1289035088 464629808 873037190 1979910459 794959240 794959240 794959240 794959240 794959240 vegasved 1024738362 341983418 1430176509 344091852 794959240 794959240 464629808 464629808 1882731028 794959240 794959240 794959240 794959240 794959240 794959240 794959240 384930616 794959240 794959240 794959240 794959240 794959240 464629808 464629808 794959240 464629808 794959240 677180350 677180350 794959240 677180350 301690636 301690636 794959240 383123477 383123477 383123477 671121685 671121685 794959240 794959240 794959240 2044177248 inspero 728253404 1430176509 1430176509 1430176509 2043281165 1289035088 1430176509 1430176509 344091852 344091852 794959240 1472374881 1472374881 794959240 794959240 794959240 794959240 344091852 1289035088 659523922 158797475 inspero 1882731028 794959240 794959240 794959240 794959240 794959240 794959240 794959240 794959240 794959240 794959240 794959240 1024738362 1119502946 344091852 1030938781 1936314241 2011132359 344091852 unicornwerewolf 1289035088 794959240 794959240 645845854 794959240 794959240 794959240 794959240 794959240 794959240 794959240
1641264279 2011132359 2011132359 2011132359 653537333 653537333 231563443 231563443 794959240 1024738362 794959240 shivasiddharth 794959240 794959240 160648997 2011132359 794959240 shivasiddharth 794959240 1255315769 794959240 971896604 794959240 971896604 794959240 794959240 796017561 1255315769 794959240 794959240 1942686605 2011132359 2011132359 2011132359 794959240 794959240 18825015 sparkxster 794959240 vegasved 794959240 344091852 794959240 794959240 794959240 794959240 344091852 1979910459 636861889 344091852 794959240 1979910459 794959240 344091852 794959240 inspero 648827505 344091852 794959240 1641264279 794959240 794959240 794959240 636861889 1641264279 2044177248 794959240 794959240 1030938781 1742579183 572566317 inspero 2009017451 794959240 794959240 1640795193 244674104 794959240 794959240 794959240 794959240 2108752044 572566317 796017561 1742579183 794959240 794959240 344091852 1024738362 794959240 794959240 315925251 648827505 794959240 794959240 315925251 cassadee inspero cassadee inspero 1979910459 794959240 794959240 794959240 794959240 794959240 794959240 143183704 1979910459 1255315769 1289035088 794959240 794959240 794959240 360443789 mssnglnk 796017561 1255315769 794959240 794959240 1063541354 1328029828 794959240 1328029828 794959240 794959240 794959240 143183704 347211813 2043281165 794959240 794959240 95691339 794959240 794959240 794959240 794959240 794959240 265819191 stelboe 1471890730 1024738362 143183704 29968412 794959240 1472374881 794959240 794959240 794959240 794959240 794959240 1255315769 cassadee 388904050 1289035088 inspero inspero 648827505 felixkim 1471890730 1471890730 143183704 794959240 143183704 inspero 212692344 sparkxster 794959240 794959240 794959240 794959240 794959240 525089662 102902226 cassadee 143183704 794959240 794959240 794959240 794959240 1024738362 1687709187 830001776 830001776 830001776 794959240 1890562474 794959240 794959240 1890562474 794959240 794959240 794959240 1677728595 1024738362 648827505 1328658675 1298879274 1289035088 794959240 794959240 inspero 572566317 1024738362 inspero 794959240 1024738362 794959240 794959240 794959240 794959240 1289035088 648827505 648827505 shivasiddharth 572566317 794959240 794959240 794959240 cassadee shivasiddharth inspero 1472374881 1472374881 525089662 794959240 1942686605 inspero 1472374881 inspero 237902823 212692344 1289035088 1472374881 inspero 1472374881 1149889731 shivasiddharth 1024738362 1289035088 794959240 794959240 794959240 794959240 794959240 1957484080 1957484080 878996580 1024738362 shivasiddharth 1202235094 1332825064 shivasiddharth 794959240 794959240 shivasiddharth 794959240 794959240 794959240 794959240 794959240 794959240 794959240 inspero 1298879274 1184017324 cassadee inspero inspero cassadee 796017561 inspero sparkxster shivasiddharth 1024738362 shivasiddharth 1880305534 shivasiddharth 1530123874 1101737592 525089662 inspero shivasiddharth 1880305534 794959240 794959240 794959240 794959240 794959240 794959240 143183704 unicornwerewolf unicornwerewolf 1472374881 philcassell 979724834 794959240 felixkim 794959240 794959240 felixkim 18825015 inspero 1472374881 philcassell inspero 1472374881 794959240 794959240 shivasiddharth shivasiddharth shivasiddharth felixkim 794959240 250887333 866391821 1024738362 250887333 1060921719 794959240 1472374881 794959240 1472374881 250887333 2104848058 250887333 983397869 250887333 983397869 250887333 250887333 250887333 2104848058 2104848058 250887333 250887333 250887333 250887333 794959240 794959240 794959240 794959240 794959240 794959240 250887333 524552396 794959240 524552396 794959240 794959240 983397869 983397869 794959240 794959240 794959240 2104848058 794959240 794959240 2104848058 794959240 794959240 794959240 2104848058 794959240 2104848058 983397869 983397869 794959240 794959240 524552396 794959240 524552396 794959240 felixkim 2104848058 333580554 250887333 inspero 1971952145 inspero 755417874 250887333 250887333 250887333 250887333 250887333 250887333 250887333 250887333 250887333 250887333 250887333 250887333 250887333 1472374881 250887333 250887333 250887333 250887333 250887333 250887333 1640795193 755417874 1024738362 1472374881 796017561 1277702896 inspero 1890562474 1060921719 250887333 inspero 1192200229 inspero 250887333 248194716 248194716 2030482438 794959240 inspero 542415372 inspero 794959240 955901347 794959240 794959240 794959240 794959240 794959240 794959240 794959240 678644647 1094742639 1971952145 1641855695 924561261 1024738362 1206590166 1206590166 inspero 678989421 inspero 2104848058 inspero inspero 525089662 333580554 inspero 524552396 inspero inspero inspero inspero inspero inspero inspero 2117733844 1024738362 64313570 inspero inspero 1024738362 1383695146 inspero inspero 1060921719 inspero 715684691 159591613 inspero inspero 1060921719 715684691 1060921719 794959240 inspero 1973698103 794959240 1973698103 794959240 301892085 794959240 1472374881 794959240 inspero 2135661401 794959240 794959240 794959240 likeapunpun 678644647 301892085 794959240 inspero unicornwerewolf 417197042 inspero 525089662 inspero inspero inspero 878996580 878996580 301892085 384930616 inspero 384930616 inspero 1677728595 165654883 1161261191 27254771 shivasiddharth inspero 255046417 794959240 1255315769 inspero 575839374 inspero 575839374 794959240 794959240 inspero inspero 794959240 820909221 sparkxster 1144206602 416760475 95691339 inspero 983397869 794959240 575839374 inspero 794959240 333580554 983397869 794959240 416760475 sparkxster 95691339 inspero 794959240 1957484080 inspero 2044177248 794959240 1957484080 794959240 sparkxster 1957484080 inspero skim620 794959240 1255315769 794959240 1255315769 794959240 1640795193 794959240 inspero noodle4001 794959240 inspero 794959240 267740704 1640795193 794959240 794959240 inspero 1677728595 inspero aprildamaso 416760475 inspero 387647469 794959240 273319507 inspero 416760475 794959240 unicornwerewolf 794959240 noodle4001 416760475 794959240 unicornwerewolf 794959240 1255315769 inspero 794959240 794959240 1298879274 nswint inspero 794959240 1255315769 1472374881 794959240 794959240 themantimeforgot 794959240 794959240 1472374881 471142115 120685372 794959240 471142115 794959240 inspero 794959240 2044177248 1720221761 inspero 996557550 794959240 inspero 141748059 794959240 12141699 794959240 inspero 12141699 794959240 416760475 794959240 695595997 794959240 794959240 iamdefiler inspero 1472374881 1009147578 inspero inspero inspero 1053695170 1354963070 794959240 95691339 inspero 794959240 1472374881
In [ ]:
driver.quit()
Request-sent
In [121]:
print(root + discover_link)
https://www.kickstarter.com//discover/newest?ref=discovery_overlay