webpage

Selenium - Find all elements of a web page

倾然丶 夕夏残阳落幕 提交于 2021-02-18 09:32:18
问题 I am planning a tool in Java which would have a drop down containing all the elements of a web page. Is there any way I can read those into a data structure? 回答1: Yes, there is a way. Here is some pseudo-code: List<WebElement> el = driver.findElements(By.cssSelector("*")); for ( WebElement e : el ) { add(e.tagName()); } 回答2: non-pseudo C# version of above: (although I'm just displaying the results in a console IReadOnlyCollection el = driver.FindElements(By.CssSelector("*")); foreach

Selenium - Find all elements of a web page

自古美人都是妖i 提交于 2021-02-18 09:31:13
问题 I am planning a tool in Java which would have a drop down containing all the elements of a web page. Is there any way I can read those into a data structure? 回答1: Yes, there is a way. Here is some pseudo-code: List<WebElement> el = driver.findElements(By.cssSelector("*")); for ( WebElement e : el ) { add(e.tagName()); } 回答2: non-pseudo C# version of above: (although I'm just displaying the results in a console IReadOnlyCollection el = driver.FindElements(By.CssSelector("*")); foreach

LoadError: cannot load such file — capybara Stand Alone Code

独自空忆成欢 提交于 2021-02-08 15:32:53
问题 I'm working on building a simple post miner using Ruby and the following tutorial (http://ngauthier.com/2014/06/scraping-the-web-with-ruby.html) Here is my code I currently have: #!/usr/bin/ruby require 'capybara' require 'capybara/poltergeist' include Capybara::DSL Capybara.default_driver = :poltergeist visit "http://dilloncarter.com" all(".posts .post ").each do |post| title = post.find("h1 a").text url = post.find("h1 a")["href"] date = post.find("a")["datetime"] summary = post.find("p

How to fix “page trying to load scripts from unauthenticated source” [closed]

隐身守侯 提交于 2021-02-07 14:51:15
问题 Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . Improve this question How can I fix this in my PHP page that contains ad scripts? I have added scripts. It worked fine in HTTP but after I switched my site to HTTPS, nothing is appearing. This is the error in dev console: Failed to load resource: the server responded with a status of

Chrome://inspect without internet connection

折月煮酒 提交于 2021-02-07 09:58:44
问题 I have been developing a website for a project targeting mobile phones and tablets, currently focusing on using the chrome browser. Much of this development has been done on one phone using a laptop. I had been using the "chrome://inspect/#devices" quite painlessly until I came to test on a different phone, when clicking "inspect" resulted in a white page. The problem seemed to be that as I happened to have no network connection at the time, chrome couldn't access some repository and so didnt

Chrome://inspect without internet connection

倾然丶 夕夏残阳落幕 提交于 2021-02-07 09:58:04
问题 I have been developing a website for a project targeting mobile phones and tablets, currently focusing on using the chrome browser. Much of this development has been done on one phone using a laptop. I had been using the "chrome://inspect/#devices" quite painlessly until I came to test on a different phone, when clicking "inspect" resulted in a white page. The problem seemed to be that as I happened to have no network connection at the time, chrome couldn't access some repository and so didnt

HTTP Basic Auth logout [duplicate]

泪湿孤枕 提交于 2021-01-28 07:09:24
问题 This question already has answers here : How to log out user from web site using BASIC authentication? (22 answers) Closed 3 years ago . My server is running Apache and I used .htaccess for my basic auth. However, I want my users be able to cancel the auth (log out) with a button. Is it possible and how to do that? 回答1: Basic Auth is not designed to manage log-out. If you would like to do it then you need to do the following: 1) Add a logout button to your page. 2) When user click on the log

How to apply javascript to multiple button groups

有些话、适合烂在心里 提交于 2020-07-05 23:55:10
问题 I have css and js on a button group so that when you click a button from the group it shows as active, and when you click a different button, that button becomes active and the rest are cleared. I have to have 22 of these button groups (I only put 2 here for the sake of space) on my page, when I have just one the code works, but when I add the others everything comes crumbling down, can anyone help! How do use the script multiple times, where the script is applied to every group and doesn't

How to apply javascript to multiple button groups

只愿长相守 提交于 2020-07-05 23:54:56
问题 I have css and js on a button group so that when you click a button from the group it shows as active, and when you click a different button, that button becomes active and the rest are cleared. I have to have 22 of these button groups (I only put 2 here for the sake of space) on my page, when I have just one the code works, but when I add the others everything comes crumbling down, can anyone help! How do use the script multiple times, where the script is applied to every group and doesn't

How to apply javascript to multiple button groups

南楼画角 提交于 2020-07-05 23:54:02
问题 I have css and js on a button group so that when you click a button from the group it shows as active, and when you click a different button, that button becomes active and the rest are cleared. I have to have 22 of these button groups (I only put 2 here for the sake of space) on my page, when I have just one the code works, but when I add the others everything comes crumbling down, can anyone help! How do use the script multiple times, where the script is applied to every group and doesn't