Using Inspect Element Console to render slides and click - web-inspector

I'm wondering if anyone can help me with this two part problem.
I want to load all of the "swiper-slide" items inside this swiper container. They will only load if manualy scrolling through. I'm wondering if there's a way to force them to all be rendered using web-inspect console.
Is there a way to select one of the slides / button containers using inspect element console on a browser without resorting to using a headless browser.
Code / swiper slider / slides

Related

Intercept Chrome translating with js

I have chrome extension and auto translate option on Chrome is changing some dates on page, which cause some errors while data processing.
Is it possible to turn of translate of the page, from the content script?
I have tried with appending the element with also tried to add class "notranslate" to .

Getting error Element not interactable on trying to send Page Down keys to div

I am trying to scroll Telegram using selenium in python. In the attached screenshot I have shared I have selected 'Members' as the element to send Keys.PAGE_DOWN as it is stick all the time to top and is static while scrolling so it should be visible all the time and can be the perfect element to send Keys.PAGE_DOWN to.
But on sending page_down I get error 'Element not Interactable'.
Any suggestions what I am doing wrong?
I have attached the script and screenshot.
I am using python 3.10 and selenium latest version.
`driver.find_element(By.XPATH, "//*[#id='RightColumn']/div[2]/div/div/div[2]/div[2]/div[1]").send_keys(Keys.PAGE_DOWN)`
I have tried all the answers currently available on the internet and they don't work here. This looks like some complex issue.
I think Selenium is throwing the right error message as this div is not an interactable element and you are trying to send keystrokes into the element.
Another approach for scrolling is using Javascript commands.
Find an element locator you need to scroll to.
(Ex: if you need to scroll to the bottom find the element at the bottom)
Use the below code to scroll
# Find the element in the page to scroll to
element = driver.find_element_by_xpath("//element/at/bottom/of/the/page")
# Fire javascript command to scroll in to view
driver.execute_script("arguments[0].scrollIntoView();", element)

How to find xpath of js rendered element for puppeteer

Im trying to interact with a js rendered page. Essentially this is a free widget from tradingview; however, the color of the lines is not something I can change. (yes there is an override, however, it only affects 1 line) I need to be able to change 2 lines.
Trading View Advanced Chart Widget Constructor
Can anyone tell me if this is possible with a puppeteer? How can I get XPath for an element which is generated by JS? View source and developer tools do not provide any xpaths to the elements.

Selenium , Python and Chrome Webdriver problem

I am learning Python and attempting to build a program that will scrape specific data from a website, store it and then manipulate it.
Currently I run my application, it opens a new chrome browser window and loads the page correctly. The problem is it should begin to start scrolling down and loading the remaining elements on the page.
I know the code works because if I manually click somewhere on the page that doesn't normally illicit a response (white space/empty areas) the browser somehow comes into "focus" and begins to iterate through the loop that scrolls down the page (by sending keys) prints the data I am after. I also noticed if I click another similar "dead space" area that contains the header, it doesn't have the same effect. I am unsure if this is something specific to Chrome, iFrames or something of that nature but I am completely stumped and would greatly appreciate any help.
Any thoughts on why I need to manually click on the new chrome window for it to work would be great.
Update: Still having the same issue, even tried with Safari and the same problem seems to exist.
Fixed this with:
element = driver.find_element_by_css_selector("div[id^='app-container']")
action = ActionChains(driver)
action.click(on_element = element)
action.perform()

How do I scroll down to the end of web page using webdriver js and Node js

driver.executeScript("window.scrollTo(0, document.body.scrollHeight);"))
I have tried the above code but it returns window is not defined.
Data keeps on loading as I scroll down the page until the search data ends.
Try having a very large number instead of the scrollHeight attribute.
Something like this
browser.executeScript('window.scrollTo(0,10000);');

Resources