heehehe / job-trend

[DE4E] 개발자 채용공고 데이터 추출 파이프라인 구축 및 응용 프로젝트
https://job-trend.streamlit.app
17 stars 2 forks source link

crawling 리팩토링 #35

Closed heehehe closed 4 months ago

heehehe commented 5 months ago

heehehe commented 5 months ago

jobplanet 실행 오류 🥲

$ python3 script/crawling.py -s jobplanet -d ./data -m get_url_list
INFO:root:[INFO] Set instance of crawling
INFO:root:[INFO] Get recruit content info
Traceback (most recent call last):
  File "script/crawling.py", line 795, in <module>
    main(args)
  File "script/crawling.py", line 782, in main
    method()
  File "script/crawling.py", line 398, in get_url_list
    job_find_window(job_filter)
  File "script/crawling.py", line 360, in job_find_window
    driver.find_element(By.CLASS_NAME, "jply_btn_sm.inner_text.jf_b2").click()
  File "/Users/user/Library/Python/3.8/lib/python/site-packages/selenium/webdriver/remote/webdriver.py", line 741, in find_element
    return self.execute(Command.FIND_ELEMENT, {"using": by, "value": value})["value"]
  File "/Users/user/Library/Python/3.8/lib/python/site-packages/selenium/webdriver/remote/webdriver.py", line 347, in execute
    self.error_handler.check_response(response)
  File "/Users/user/Library/Python/3.8/lib/python/site-packages/selenium/webdriver/remote/errorhandler.py", line 229, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: ; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception
dbsgh3344 commented 5 months ago

jobplanet 실행 오류 🥲

$ python3 script/crawling.py -s jobplanet -d ./data -m get_url_list
INFO:root:[INFO] Set instance of crawling
INFO:root:[INFO] Get recruit content info
Traceback (most recent call last):
  File "script/crawling.py", line 795, in <module>
    main(args)
  File "script/crawling.py", line 782, in main
    method()
  File "script/crawling.py", line 398, in get_url_list
    job_find_window(job_filter)
  File "script/crawling.py", line 360, in job_find_window
    driver.find_element(By.CLASS_NAME, "jply_btn_sm.inner_text.jf_b2").click()
  File "/Users/user/Library/Python/3.8/lib/python/site-packages/selenium/webdriver/remote/webdriver.py", line 741, in find_element
    return self.execute(Command.FIND_ELEMENT, {"using": by, "value": value})["value"]
  File "/Users/user/Library/Python/3.8/lib/python/site-packages/selenium/webdriver/remote/webdriver.py", line 347, in execute
    self.error_handler.check_response(response)
  File "/Users/user/Library/Python/3.8/lib/python/site-packages/selenium/webdriver/remote/errorhandler.py", line 229, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: ; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception

같은 이슈인진 확실하지 않지만 제가 실행했을 때 발생하던 오류 수정했습니다! 원인 : popup창이 떠서 selenium에서 element들을 캐치하지 못했던 이슈 해결 : 웹사이트 크롤링 시작 시 뜨는 popup창을 먼저 제거하고 크롤링 시작하도록 수정