rodrigozc
Hello everyone,
I’m trying to automating navigation using Hound, but I’m having some troubles with select/option elements and how to interact with them.
For instance, I tried in different ways to select an option from the site “https://www.imovelweb.com.br/.”
I tried the solution below but didn’t work.
https://github.com/HashNuke/hound/issues/72#issuecomment-178071219
I’m using the selenium driver with the chrome browser.
$ brew install selenium-server-standalone
$ selenium-server -port 4444
use Mix.Config
config :hound,
driver: "selenium",
browser: "chrome"
I tried to select in the following ways:
def search() do
Hound.start_session()
navigate_to(@url)
find_element(:css, "#operationType option[value='1']")
|> click
#take_screenshot()
rescue
e ->
IO.inspect(e)
:notfound
after
Hound.end_session
end
Error
%RuntimeError{
message: "element not interactable: Element is not currently visible and may not be manipulated\n (Session info: chrome=79.0.3945.88)\nBuild info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'\nSystem info: host: 'Rodrigos-MacBook-Pro.local', ip: '2804:14c:4a:9f9d:1591:2820:1fe7:d763', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.15.2', java.version: '1.8.0_131'\nDriver info: driver.version: unknown"
}
def search() do
Hound.start_session()
navigate_to(@url)
find_element(:css, "#operationType")
|> find_within_element(:css, "option[value='1']")
|> click
#take_screenshot()
rescue
e ->
IO.inspect(e)
:notfound
after
Hound.end_session
end
Error
%RuntimeError{
message: "element not interactable: Element is not currently visible and may not be manipulated\n (Session info: chrome=79.0.3945.88)\nBuild info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'\nSystem info: host: 'Rodrigos-MacBook-Pro.local', ip: '2804:14c:4a:9f9d:1591:2820:1fe7:d763', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.15.2', java.version: '1.8.0_131'\nDriver info: driver.version: unknown"
}
I was wondering if I have to click on the select element before to show the options and then click on the chosen option, but when I tried to click on the select element I got another error.
def search() do
Hound.start_session()
navigate_to(@url)
find_element(:css, "#operationType")
|> click
#take_screenshot()
rescue
e ->
IO.inspect(e)
:notfound
after
Hound.end_session
end
Error
%RuntimeError{
message: "element not interactable\n (Session info: chrome=79.0.3945.88)\nBuild info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'\nSystem info: host: 'Rodrigos-MacBook-Pro.local', ip: '2804:14c:4a:9f9d:1591:2820:1fe7:d763', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.15.2', java.version: '1.8.0_131'\nDriver info: driver.version: unknown"
}
Thanks!
Trending in Questions
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hello,
I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
Hi everyone,
I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding.
I sta...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
I’m new to elixir and just tried to install the elixirLS extension for VScode(ium) and it is throwing some errors that I would like help ...
New
Other Trending Topics
Edit: 2026 May 15 - This post is archived.
Mob is alive!!
Main docs: mob v0.7.11 — Documentation
A bit of explanation for the slightly c...
New
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Hi everyone!
The first release candidate for the Expert language server project is now available!
We’ve published a press release detai...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #ai
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #elixirconf-eu
- #metaprogramming
- #hex










Showing Posts 1 to 9- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
wolfiton
I don’t see this in your code
This is what I am using to test by following this book https://shankardevy.com/phoenix-inside-out-mpf/ . But it uses phantomjs
Also if you use Linux install phantomjs like this Problem with acceptance test in hound not starting server on port 4001
Update found this in my tests, it might be similar with what you need:
rodrigozc
I’m using hound to get some informations from a website, not for test purposes, sorry about my tag
test, it’s not the case.My module contains
use Hound.Helpers, I think thathound_session()is used just in test cases to setup the session in thesetupmethod.I tried using
PhantomJStoo, in this case, I did not even make it select the option. When I inspected the HTML, the option values were blank. It’s weird, I know, so I changed the code to use theSelenium.I’m starting and finishing the session in the method.
Below is the whole module.
wolfiton
To use phantomjs you need to run this
phantomjs --wdin a terminal window and at the same time in a new window yourmix phx.serverThat should work. If it doesn’t I really don’t know what is happening.
wolfiton
Are you trying to extract something from a webpage?
If so then HTTPoison(GitHub - edgurgel/httpoison: Yet Another HTTP client for Elixir powered by hackney · GitHub) might be a better option and this GitHub - philss/floki: Floki is a simple HTML parser that enables search for nodes using CSS selectors. · GitHub
rodrigozc
The idea is to use navigation with Hound to filter some data filling the form and after that to use Floki to parse data.
rodrigozc
With
PhantonJSI cannot find the element, executing the same find_element I got the error below.Inspecting the
#operationTypeelement withPhantonJSI saw that all options had blank values.wolfiton
This is strange have you tried to extract just an h1 tag to see if hound is working?
rodrigozc
Yes, I can get h1 tag.
Result:
wolfiton
OK then how about writing your select like this:
If this doesn’t work either then try to create a minimal example only with a slect and test hound on that to see if that works.
If it does then you most certenly have a problem in your actual code or a bug.