Skip to content

Commit 8b8df01

Browse files
committed
fix #37
1 parent 4204922 commit 8b8df01

File tree

4 files changed

+50
-40
lines changed

4 files changed

+50
-40
lines changed

.env

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
SCWEET_USERNAME=
2-
SCWEET_PASSWORD=
1+
SCWEET_USERNAME=@arobask1
2+
SCWEET_PASSWORD=mmm010203

Scweet/Example.ipynb

+42-34
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@
313313
},
314314
{
315315
"cell_type": "code",
316-
"execution_count": 3,
316+
"execution_count": 2,
317317
"metadata": {},
318318
"outputs": [],
319319
"source": [
@@ -518,7 +518,7 @@
518518
},
519519
{
520520
"cell_type": "code",
521-
"execution_count": 3,
521+
"execution_count": null,
522522
"metadata": {
523523
"scrolled": true
524524
},
@@ -528,14 +528,13 @@
528528
"output_type": "stream",
529529
"text": [
530530
"Scraping on headless mode.\n",
531-
"Crawling @NAgouzil following\n",
531+
"Crawling @nagouzil following\n",
532532
"Found 9 following\n",
533533
"Found 38 following\n",
534534
"Found 60 following\n",
535-
"Found 79 following\n",
536-
"Found 81 following\n",
537-
"Found 81 following\n",
538-
"Crawling @Yassineaitjeddi following\n",
535+
"Found 80 following\n",
536+
"Found 80 following\n",
537+
"Crawling @@yassineaitjeddi following\n",
539538
"Found 10 following\n",
540539
"Found 40 following\n",
541540
"Found 60 following\n",
@@ -560,30 +559,30 @@
560559
"Found 279 following\n",
561560
"Found 299 following\n",
562561
"Found 318 following\n",
563-
"Found 339 following\n",
562+
"Found 338 following\n",
564563
"Found 359 following\n",
565564
"Found 378 following\n",
566-
"Found 380 following\n",
567-
"Found 380 following\n",
568-
"Crawling @LolitaPoupat following\n",
565+
"Found 381 following\n",
566+
"Found 381 following\n",
567+
"Crawling @lolitapoupat following\n",
569568
"Found 10 following\n",
570569
"Found 39 following\n",
571570
"Found 39 following\n",
572-
"Crawling @Jade_happiness following\n",
571+
"Crawling @@Jade_happiness following\n",
573572
"Found 9 following\n",
574573
"Found 38 following\n",
575574
"Found 58 following\n",
576-
"Found 79 following\n",
575+
"Found 78 following\n",
577576
"Found 99 following\n",
578577
"Found 120 following\n",
579578
"Found 139 following\n",
580579
"Found 160 following\n",
581580
"Found 180 following\n",
582581
"Found 182 following\n",
583582
"Found 182 following\n",
584-
"Crawling @nabila_gl following\n",
583+
"Crawling @@Nabila_Gl following\n",
585584
"Found 9 following\n",
586-
"Found 38 following\n",
585+
"Found 39 following\n",
587586
"Found 60 following\n",
588587
"Found 80 following\n",
589588
"Found 100 following\n",
@@ -593,15 +592,32 @@
593592
"Found 180 following\n",
594593
"Found 200 following\n",
595594
"Found 220 following\n",
596-
"Found 239 following\n",
597-
"Found 260 following\n",
595+
"Found 240 following\n",
598596
"Found 260 following\n",
599-
"Found 294 following\n",
600-
"Found 315 following\n",
601-
"Found 334 following\n",
602-
"Found 353 following\n",
603-
"Found 363 following\n",
604-
"Found 363 following\n"
597+
"Found 280 following\n",
598+
"Found 298 following\n",
599+
"Found 318 following\n",
600+
"Found 338 following\n",
601+
"Found 357 following\n",
602+
"Found 368 following\n",
603+
"Found 368 following\n",
604+
"Crawling @geceeekusuu following\n",
605+
"Found 9 following\n",
606+
"Found 38 following\n",
607+
"Found 59 following\n",
608+
"Found 78 following\n",
609+
"Found 99 following\n",
610+
"Found 120 following\n",
611+
"Found 139 following\n",
612+
"Found 159 following\n",
613+
"Found 179 following\n",
614+
"Found 200 following\n",
615+
"Found 219 following\n",
616+
"Found 240 following\n",
617+
"Found 259 following\n",
618+
"Found 280 following\n",
619+
"Found 296 following\n",
620+
"Found 296 following\n"
605621
]
606622
}
607623
],
@@ -611,19 +627,11 @@
611627
},
612628
{
613629
"cell_type": "code",
614-
"execution_count": 8,
630+
"execution_count": null,
615631
"metadata": {},
616-
"outputs": [
617-
{
618-
"name": "stdout",
619-
"output_type": "stream",
620-
"text": [
621-
"['@tweetsauce', '@jockowillink', '@brfootball', '@433', '@Ibra_official', '@HSHQ', '@Snowden', '@johnkrasinski', '@fireship_dev', '@zinebmouchrik', '@Dannmace', '@Kurz_Gesagt', '@reactjs', '@dribbble', '@UpLabs', '@sketch', '@materialdesign', '@GoogleDesign', '@ayoubagouzil', '@garyvee', '@368', '@brielarson', '@Tesla', '@MehdiElIdriss23', '@Spotify', '@DavidDobrik', '@ddlovato', '@Dave2D', '@verge', '@StephenCurry30', '@KingJames', '@olivia_holt', '@saradietschy', '@petermckinnon', '@colesprouse', '@jakerawr', '@Casey', '@hkasulka', '@MandyPandyLeigh', '@Phil_Coutinho', '@KevinHart4real', '@BillGates', '@elonmusk', '@oneplus', '@dbrand', '@MKBHD', '@UnboxTherapy', '@TheRock', '@JDMorgan', '@AADaddario', '@jimmyfallon', '@ConanOBrien', '@alexandrabreck1', '@RealHughJackman', '@MelissaBenoist', '@HARDWELL', '@TahaAlamIdrissi', '@Eminem', '@SnoopDogg', '@GiGiHadid', '@Ucefmab', '@SalmaRach', '@ultra', '@MartinGarrix', '@YouTube', '@BadoAbdo', '@iWillSmith', '@ivanrakitic', '@Adele', '@SergiRoberto10', '@taylorswift13', '@LuisSuarez9', '@selenagomez', '@KendallJenner', '@jtimberlake', '@CHANEL', '@justinbieber', '@davidguetta', '@TeamMessi', '@neymarjr', '@BarackObama']\n"
622-
]
623-
}
624-
],
632+
"outputs": [],
625633
"source": [
626-
"print(following['NAgouzil'])"
634+
"print(following['nagouzil'])"
627635
]
628636
},
629637
{

Scweet/debug.log

+4
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,7 @@
7979
[0119/010217.540:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3)
8080
[0119/094952.552:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3)
8181
[0119/133131.458:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3)
82+
[0120/113020.986:ERROR:process_reader_win.cc(123)] NtOpenThread: {Access Denied} A process has requested access to an object, but has not been granted those access rights. (0xc0000022)
83+
[0120/113021.124:ERROR:exception_snapshot_win.cc(99)] thread ID 19800 not found in process
84+
[0120/113020.967:ERROR:process_reader_win.cc(123)] NtOpenThread: {Access Denied} A process has requested access to an object, but has not been granted those access rights. (0xc0000022)
85+
[0120/113021.124:ERROR:exception_snapshot_win.cc(99)] thread ID 8272 not found in process

Scweet/utils.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,6 @@ def log_search_page(driver, start_date, end_date, lang, display_type, words, to_
159159
end_date = "until%3A" + end_date + "%20"
160160
start_date = "since%3A" + start_date + "%20"
161161

162-
# to_from = str('%20'.join([from_account,to_account]))+"%20"
163-
164162
if display_type == "Latest" or display_type == "latest":
165163
display_type = "&f=live"
166164
elif display_type == "Image" or display_type == "image":
@@ -261,7 +259,7 @@ def get_users_follow(users, headless, follow=None, verbose=1, wait=2):
261259
driver.get('https://twitter.com/' + user)
262260
sleep(random.uniform(wait-0.5, wait+0.5))
263261
# find the following or followers button
264-
driver.find_element_by_xpath('//a[contains(@href,"/' + user + '/' + follow + '")]/span[1]/span[1]').click()
262+
driver.find_element_by_xpath('//a[contains(@href,"/' + follow + '")]/span[1]/span[1]').click()
265263
sleep(random.uniform(wait-0.5, wait+0.5))
266264
# if the log in fails, find the new log in button and log in again.
267265
if check_exists_by_link_text("Log in", driver):
@@ -271,7 +269,7 @@ def get_users_follow(users, headless, follow=None, verbose=1, wait=2):
271269
sleep(random.uniform(wait-0.5, wait+0.5))
272270
driver.get('https://twitter.com/' + user)
273271
sleep(random.uniform(wait-0.5, wait+0.5))
274-
driver.find_element_by_xpath('//a[contains(@href,"/' + user + '/' + follow + '")]/span[1]/span[1]').click()
272+
driver.find_element_by_xpath('//a[contains(@href,"/' + follow + '")]/span[1]/span[1]').click()
275273
sleep(random.uniform(wait-0.5, wait+0.5))
276274
# check if we must keep scrolling
277275
scrolling = True

0 commit comments

Comments
 (0)