|
| 1 | +from seleniumbase import SB |
| 2 | + |
| 3 | +with SB(uc=True, test=True) as sb: |
| 4 | + url = "https://www.indeed.com/companies/search" |
| 5 | + sb.activate_cdp_mode(url) |
| 6 | + sb.sleep(2) |
| 7 | + sb.uc_gui_click_captcha() |
| 8 | + sb.sleep(1) |
| 9 | + company = "NASA Jet Propulsion Laboratory" |
| 10 | + sb.press_keys('input[data-testid="company-search-box"]', company) |
| 11 | + sb.click('button[type="submit"]') |
| 12 | + sb.click('a:contains("%s")' % company) |
| 13 | + sb.sleep(3) |
| 14 | + sb.cdp.highlight('div[itemprop="name"]') |
| 15 | + sb.sleep(1) |
| 16 | + sb.cdp.highlight('h2:contains("About the company")') |
| 17 | + sb.sleep(2) |
| 18 | + for i in range(10): |
| 19 | + sb.cdp.scroll_down(12) |
| 20 | + sb.sleep(0.14) |
| 21 | + info = sb.find_element('[data-testid="AboutSection-section"]') |
| 22 | + soup = sb.get_beautiful_soup(info.get_html()).get_text("\n").strip() |
| 23 | + print("*** %s: ***\n%s" % (company, soup.replace("\n:", ":"))) |
0 commit comments