Comments (10)
The first option (breaking change) seems like the right approach here
from thirtyfour.
I assume the same should apply to get_property()
and get_css_property()
from thirtyfour.
I agree with get_property()
, but i don't know for get_css_property()
...
from thirtyfour.
Wouldn't a CSS property always have a value, unless the name is invalid?
from thirtyfour.
I've tested it and when running
c.get("https://google.si").await?;
println!("Value: {:?}", c.query(By::Css(r#"html"#)).wait().first().await?.get_css_property("background-colo").await?);
println!("Value: {:?}", c.query(By::Css(r#"html"#)).wait().first().await?.get_css_property("background-color").await?);
It returns
Value: ""
Value: "rgba(0, 0, 0, 0)"
It returns a empty string if the name is invalid
from thirtyfour.
If you look at the code for get_attribute() you will see that if the value is not a string type then it converts it into a string. That should probably just return None instead (and Some if it is a string type).
from thirtyfour.
The same logic is used for the other two methods which is why I suggested they would benefit from the same change
from thirtyfour.
The standard for get_css_property()
says that to return ""
in the else case, so making it a Option (by checking if not a string) wouldn't do anything .
from thirtyfour.
Fair enough 👍
from thirtyfour.
Fixed in 9f506dc
from thirtyfour.
Related Issues (20)
- Sematics around query from element HOT 2
- How does the library operate on a web page that the user has already opened HOT 3
- How use proxy in that library HOT 2
- When set_headless for chrome chrome=111.0.5563.146, cannot locate loginsubmit button HOT 2
- add_arg is not found within EdgeCapabilities HOT 2
- A workaround for drag_and_drop_element HOT 3
- javascriptEnabled is not the name of a known capability or extension capability HOT 1
- Can not to connect to remote webdriver. HOT 4
- 0.32 release, Potential segfault in the time crate HOT 1
- Deal with iframe, not working HOT 1
- Auto setup `chromedriver` and `geckodriver` HOT 2
- how to automatically run the webdriver before running the program? HOT 2
- Proxy doesn't work in Chrome. HOT 1
- so, how to get the text value of an element HOT 1
- Error while clicking element. HOT 4
- `#shadow-root` doesn't work on Firefox with geckodriver HOT 1
- Connection refused when using containers HOT 4
- How to use selenium-manager in my code? HOT 2
- thread 'tokio-runtime-worker' panicked at 'internal error: entered unreachable code: received unknown error (no such frame) for NOT_FOUND status code' HOT 4
- How can I set the user-agent for Chromedriver? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from thirtyfour.