0

은 "무엇"형태 (일명 직책)을 얻기 위해 시도를 통해 필드 "Q"(카피 바라 :: ElementNotFound를) 찾을 수 없습니다 :indeed.com에서 프로그램 실행하려고</p> <p>오류 FILL_IN

/var/lib/gems/2.3.0/gems/capybara-2.11.0/lib/capybara/node/finders.rb:44:in `block in find': Unable to find field "q" (Capybara::ElementNotFound) 

indeed.com 수율 파이어 폭스 통해 소자 검사 :

: 스크레이퍼의 코드와 일치 name="q"

<span class="inwrap"> 
<input class="input_text" maxlength="512" size="31" aria-labelledby="what_label_top hidden_colon what_label_bot" name="q" autocomplete="off" id="what"> 
</span> 
<div style="width:250px"><!-- --></div> 

이제 여기에 문제가 name="q" 내가 webscraping을 시작할 수 있도록 내가 indeed.com에 해당 양식에 링크 수있는 다른 방법이 찾을 수 없다는이 https://github.com/jasnow/job-hunter/blob/master/scraper.rb

:

전체 코드

def perform_search 
# For indeed 
fill_in 'q', :with => @skillset 
fill_in 'l', :with => @region 
find('#fj').click 
sleep(1) 
end 
에서 찾을 수 있습니다? 나는 아마도 xpath 또는 css를 말하고있다.

답변

2

코드는 http://www.indeed.com URL 만 허용하지만 해당 URL은 https://www.indeed.com으로 리디렉션되고 http://indeed.com에 도달합니다. 따라서 페이지로드가 차단되고 있습니다. config.allow_url("indeed.com")으로 변경하면 입력을 찾을 수 있습니다.

+0

효과가 있습니다. 고맙습니다! – user3787179