TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Helium: Lighter Web Automation with Python

199 点作者 mherrmann5 个月前

17 条评论

hugs5 个月前
Selenium project founder here. (Hi!) Thanks for all your work on this project. Lots of negativity around here these days, but just wanted to say thanks. The functional style of Helium&#x27;s API reminds me a lot of Selenium&#x27;s original API when it was 100% JavaScript (aka Selenium 1 aka Selenium Core) back in 2004.<p>(Functional style: &quot;method(thing)&quot; vs object oriented style: &quot;thing.method()&quot;)<p>We mostly abandoned the functional style when we merged with the WebDriver project (aka Selenium 2), but that functional style still lives on in the Selenium IDE record&#x2F;playback tool.<p>That is all to say, there are fans of many different styles for automation APIs. No single API will please everyone. (But I personally like the simpler, functional style, fwiw!)<p>Side-note: This is also why I&#x27;m a fan of the Nim programming language. &quot;method(thing)&quot; and &quot;thing.method&quot; are supported syntax for literally the same thing. For others new to the idea, the fancy term for this is &quot;Uniform Function Call Syntax&quot;.
评论 #42402391 未加载
languagehacker5 个月前
Importing * is universally discouraged by most Python linters and best practice docs. You can always &quot;import helium as h&quot; if you&#x27;re looking to type less.<p>This looks largely like common workarounds that most people will write using Python-based browser automation. Most of the time, we accept that those capabilities aren&#x27;t there by default because they are not explicit enough and can result in bugs and undefined behavior even when the elements that we expect to be on the page are actually there.<p>Given the adage &quot;explicit is better than implicit&quot;, I worry that a layer like this might create more trouble than it&#x27;s worth for the sake of readability. When we get into the nitty-gritty of browser automation, it might just make it harder to debug than going straight to Selenium or Playwright.
评论 #42388378 未加载
评论 #42394902 未加载
评论 #42398844 未加载
nkrisc5 个月前
Having done some ad-hoc, temporary automation with Selenium in the past (to help fellow, less technically-inclined designers) I wish I had this at the time.<p>Looks like a nice, almost natural language-like API around what is otherwise a quite cumbersome API.
wokwokwok5 个月前
How can a wrapper around selenium be lighter than it?<p>A wrapper around an API is by definition heavier (more code, more functions) than using the lower level api.<p>It’s not using less resources.<p>It’s not faster (it has implicit waiting).<p>It’s not less code; it’s literally a superset of selenium?<p>Feels like a “selenium framework” is more accurate than light weight web automation?<p>Anyway, there’s no fixing automation tests with fancy APIs.<p>No matter what you try to do, if people are only interested in writing quick dirty scripts, you’re doomed to a pile of stupid spaghetti no matter what system or framework you have.<p>If you want sustainable automation, you have to do Real Software Engineering and write actual composable modules; and you can do that in anything, even raw selenium.<p>So… I’d be more interested if this was pitched as “composable lego for building automation” …<p>…but, personally, as it stands all I can really see is “makes easy things easier with sensible defaults”.<p>That’s nice for getting started; but getting started is not the problem with automation tests.<p>It’s maintaining them.
评论 #42389017 未加载
评论 #42390217 未加载
wslh5 个月前
How does it compare with the &quot;usual suspects&quot;? I mean Playwright, Selenium, Cypress, and Puppeteer.
评论 #42387956 未加载
fermigier5 个月前
&quot;We shut down the company at the end of 2019 and I felt it would be a shame if Helium simply disappeared from the face of the earth.&quot;<p>I appreciate the effort. Thank you M. Hermann.
评论 #42387727 未加载
giis5 个月前
Looks nice. Is it possible start_chrome() with specific chrome browser profile name or re-use existing open firefox&#x2F;chrome browser session and launch a new tab with specific domain?
评论 #42389904 未加载
bilater5 个月前
Nice - I can see some cool agentic flows created using this. A thing I want to look into is creating a sandbox instance (Ubuntu?) and letting an agent do its thing. Could be collecting data or answering questions and I can pull up the window to check in from time to time. It&#x27;ll be like having an assistant.
bryanrasmussen5 个月前
How easy is it to detect that this is automation as opposed to a real user? I suppose probably pretty easy, so not sure if it is useful if I want to automate the web for things I do every day as I would really be running the risk of turning off access to those things if they determined I am automating them.
评论 #42393523 未加载
edm0nd5 个月前
Very neat!<p>Rolling in a captcha solving service like DeathByCaptcha or AntiCaptcha and you got yourself a quick and easy script that can do anything on any website regardless of captchas.
quickvi5 个月前
for lightweight automation outside the browser:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;elyase&#x2F;screenium">https:&#x2F;&#x2F;github.com&#x2F;elyase&#x2F;screenium</a>
评论 #42389217 未加载
评论 #42388669 未加载
Havoc5 个月前
That looks useful. How does it know which box is the user field? Just read label and assume the one below that or to the right of the label?
评论 #42399369 未加载
slt20215 个月前
Thank you for sharing this project, this is really good
bg245 个月前
Nice work! I looked at the cheatsheet, and it is not obvious to me how to go through two factor authentication during login.
评论 #42389565 未加载
__mharrison__5 个月前
Thanks for posting. All this AI has been interested in scraping personal sites.
评论 #42388904 未加载
crazymoka5 个月前
Can it be headless?
评论 #42388767 未加载
Byte645 个月前
This is so cool