File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change 3
3
with SB (uc = True , test = True ) as sb :
4
4
url = "https://www.indeed.com/companies/search"
5
5
sb .activate_cdp_mode (url )
6
- sb .sleep (2.2 )
7
- sb .uc_gui_click_captcha ()
8
- sb .sleep (1 )
9
- company = "NASA Jet Propulsion Laboratory"
10
6
search_box = 'input[data-testid="company-search-box"]'
7
+ if not sb .is_element_present (search_box ):
8
+ sb .sleep (2 )
9
+ sb .uc_gui_click_captcha ()
10
+ sb .sleep (1 )
11
+ company = "NASA Jet Propulsion Laboratory"
11
12
sb .click (search_box )
12
13
sb .sleep (0.1 )
13
14
sb .press_keys (search_box , company )
14
15
sb .click ('button[type="submit"]' )
15
16
sb .click ('a:contains("%s")' % company )
16
- sb .sleep (3 )
17
- sb .uc_gui_click_captcha ()
17
+ name_header = 'div[itemprop="name"]'
18
18
sb .sleep (1 )
19
- sb .cdp .highlight ('div[itemprop="name"]' )
19
+ if not sb .is_element_present (name_header ):
20
+ sb .sleep (2 )
21
+ sb .uc_gui_click_captcha ()
22
+ sb .sleep (1 )
23
+ sb .cdp .highlight (name_header )
20
24
sb .sleep (1 )
21
25
sb .cdp .highlight ('h2:contains("About the company")' )
22
- sb .sleep (2 )
26
+ sb .sleep (1 )
23
27
for i in range (10 ):
24
28
sb .cdp .scroll_down (12 )
25
29
sb .sleep (0.14 )
You can’t perform that action at this time.
0 commit comments