<br>E-mail: t.sano@hokkaido.mitsubishi-motor-sales.com<br>
<br>■三井販売(株)<br>住所:〒080-0000 北海道帯市大通南23-11 <br>TEL:0122-24-1115 <br>採用担当者: 管理部 相馬 <br>E-mail: h-so@octv.ne.jp <br><br>
HPhttps://job.mynavi.jp/19/pc/search/corp76644/outline.htmlのスクレイピングを行っています。以上のようなHPから、メールアドレスを取り出したいと考えています。
文字列の検索を行い、”@”を検索すればよいと考え以下のようにしましたが、うまくいきません。どうすればよいでしょうか?
前省略
wd.get "https://job.mynavi.jp/19/pc/search/corp76644/outline.html"
mail=wd.find_element(:xpath,"//*[contains(./text(),'@')]").text
エラーコード
C:/Ruby23/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.10.0/lib/selenium/webdriver/remote/response.rb:69:in assert_ok': no such element: Unable to locate element: {"method":"xpath","selector":"//*[contains(./text(),'@')]"} (Selenium::WebDriver::Error::NoSuchElementError) (Session info: chrome=67.0.3396.99) (Driver info: chromedriver=2.35.528161 (5b82f2d2aae0ca24b877009200ced9065a772e73),platform=Windows NT 10.0.17134 x86_64) from C:/Ruby23/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.10.0/lib/selenium/webdriver/remote/response.rb:32:in
initialize'
from C:/Ruby23/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.10.0/lib/selenium/webdriver/remote/http/common.rb:81:in new' from C:/Ruby23/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.10.0/lib/selenium/webdriver/remote/http/common.rb:81:in
create_response'
from C:/Ruby23/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.10.0/lib/selenium/webdriver/remote/http/default.rb:104:in request' from C:/Ruby23/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.10.0/lib/selenium/webdriver/remote/http/common.rb:59:in
call'
from C:/Ruby23/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.10.0/lib/selenium/webdriver/remote/bridge.rb:164:in execute' from C:/Ruby23/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.10.0/lib/selenium/webdriver/remote/oss/bridge.rb:579:in
execute'
from C:/Ruby23/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.10.0/lib/selenium/webdriver/remote/oss/bridge.rb:547:in find_element_by' from C:/Ruby23/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.10.0/lib/selenium/webdriver/common/search_context.rb:60:in
find_element'
from C:/app/pleiades/workspace/smbc/mainabi.rb:35:in block in <main>' from C:/app/pleiades/workspace/smbc/mainabi.rb:21:in
each'
from C:/app/pleiades/workspace/smbc/mainabi.rb:21:in `<main>'
あなたの回答
tips
プレビュー