Is it possible to retrieve elements trapped within a non-clickable link using Selenium in Python?

https://i.sstatic.net/b6Zss.png

https://i.sstatic.net/v5Cj6.png

The image at 2:40 PM shows a seat layout that is no longer accessible due to all seats being filled.

The image at 5:20 is clickable and directs us to a page with the current seat layout for that theater at that time.

I'm not sure how these links work behind the scenes, but I know that clicking on them will take you to another page.

Is there a way to access information about the seat layout at 2:40 pm using the elements in this div? Can we find any JavaScript associated with these elements stored elsewhere while using Selenium in Python?

Pardon my lack of technical terminology, I'm new to web development. Thank you for your assistance.

Answer №1

To determine if you can click on a specific link and proceed with booking, you can utilize the class property of the links provided. Here are two examples of the links available:

seat filling link

seat sold out link

You can cycle through all the links, extract the class attribute value, and verify if it contains 'enabled'. Links with this value are clickable.

If your goal is solely to identify clickable links, you can apply XPath filtering directly. An example XPath query could be:

//a[contains(@class,'enabled')]

Remember, this is just an illustration and may need further refinement based on your specific needs. If this solution does not align with your requirements, please provide more information for better assistance.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Encountered ElementNotInteractableException in Selenium: The element is not currently interactable

When attempting to input text into a username field, I encounter an issue where the SendKeys() function errors out with a message stating that the element is not interactable. Despite already waiting for the element to exist, the problem persists. Below is ...

Updating the state array in React hooks will replace the previous value with the new value added

How can I update a state array with new values from checkboxes without replacing the previous value? const [checked, setCheck] = useState([]); const changeCheck = (event,sku) =>{ event.preventDefault(); setCheck(prevChecked => [...prevChecked, ...

Unable to retrieve the page source/DOM from a websocket endpoint set to self-refresh

Experience a website that automatically updates with more text data. When using Chrome, attempting to view the page source may result in a blank page indefinitely. To bypass this issue, I typically utilize the Inspect tool to access the source. Despite my ...

Is there a way to extract the number from a b tag using selenium with Python?

I'm attempting to extract the numbers within all the <b> tags on this particular website. I am looking for each "qid" (question id), so I believe I need to utilize qids = driver.find_elements_by_tag_name("b"). Following suggestions fro ...

Unable to access property 'hasAttribute' of null value

I'm experiencing an issue with Material Design Bootstrap. I installed it using NPM, but when I visit my website, I encounter the following error: Uncaught TypeError: Cannot read property 'hasAttribute' of null at r (app.js:19116) at ...

Is it considered proper to initialize an empty array within the data object of a Vue.js component?

For my component, I am in need of multiple empty arrays and predefined objects. The data object structure provided below seems to be effective for my purpose. However, I am uncertain if this is the optimal pattern and whether it might lead to unforeseen co ...

Unable to refresh the page using the router link

When I click on a list item that sends itself as parameters to the routerlink, it works fine. However, when I click on another list item again, it doesn't change the page. Can someone provide guidance on this issue? This snippet is from Router.js: { ...

Utilize JavaScript or jQuery to align a list item center on a horizontal scrolling navigation bar

Currently, I am utilizing bootstrap 4.6 for a webpage, and while the default navbar doesn't meet my requirements for mobile navigation, I am attempting to customize it to function like MODE_SCROLLABLE in Android. Therefore, I need it to activate the l ...

Display text on the screen with a customized design using JavaScript's CSS styles

I need help with printing a specific page that contains some information designed in print.css. I want to print this page, including an image, with the same style. function printContent() { var divContents = document.getElementById("terms").innerH ...

I've been diving into webpack and experimenting with making an api call, but I'm hitting a roadblock. Let me share with you my code

This section pertains to the server const dotenv = require('dotenv'); dotenv.config(); // Setting up environment variables const express = require('express'); const bodyParser = require('body-parser'); const cors = require(&a ...

How can PHP handle JSON data that arrives in an incomplete format?

I have created a basic website application that interacts with an API to gather backlink data for any website entered by the user. The API sends data in JSON format, consisting of strings and numbers. After parsing the response, I filter out the desired da ...

What is the best way to access a variable within an event handler function?

Is there a way to retrieve values from the for-loop within an event handler? Consider this JSON array var items = [ { "id": "#id1", "name": "text1" }, { "id": "#id2", "name": "text2" } ]; that is passed as a parameter to the function function setHand ...

Merging multiple observables with RxJs forkJoin

UPDATE : I'm currently facing a challenging issue that I can't seem to resolve. Within my code, there is a list of objects where I need to execute 3 requests sequentially for each object, but these requests can run in parallel for different obje ...

Could we potentially collect the data placed in a droppable container and save it to a database?

I am currently working on a project where I need to drag and drop nametags (see HERE) into droppable divs and then store the data in my database. What I want to achieve is to verify if there are values in the droppable box, display a submit button, and u ...

Exploring the world of Json and html rendering

My service is designed to generate news with close to 30 different types, each requiring specific HTML code for display. When making an AJAX call, I extract the variable parts from the JSON response and use JavaScript to dynamically create and append the n ...

Display content exclusively within a modal specifically designed for mobile devices

I want to implement a feature where a button triggers a modal displaying content, but only on mobile devices. On desktop, the same content should be displayed in a div without the need for a button or modal. For instance: <div class="container&quo ...

The computer is frozen and displaying the notification, "A script on this page could be occupied or unresponsive."

When working within a webpage, a series of combo boxes can be found. Upon clicking "add", a new set of combo boxes will appear for selection. However, when using Selenium IDE to record user actions, an error may occur when attempting to select options from ...

Changing the React Native entry file name (index.ios.js)

Whenever I start a new react-native project, the file index.ios.js is generated as the main entry point for the project. Is it possible to rename this file and if yes, how can it be done? ...

Prevent user input when an alert window is open

Users keep pressing the enter key multiple times when an alert box pops up, causing them to accidentally dismiss the message by hitting 'ok'. Is there a simple way to prevent key presses on alert windows and only allow mouse input? ...

Is there a simple method to transform a JavaScript object into pairs formatted as "name": "Fred", "value": "Blue"?

I'm trying to find a solution for converting an object into a specific string format using JavaScript. Here is the object in question: Object name: Fred lastname: Jones city: Los Angeles The desired output should look like this: // Do want this [ ...