Difficulty accessing the link in India using Selenium with Python

I have been attempting to automate the process of accessing a website using Python, but the catch is that it only works when accessed from India. Unfortunately, my current code isn't getting the job done.

The existing code, complete with the website link, reads as follows:

from selenium import webdriver

driver = webdriver.Chrome()

r = driver.get("https://visa.vfsglobal.com/ind/en/pol/")

time.sleep(15)

Although I've utilized Selenium for automation purposes, it's not set in stone. I'm open to any other library or method that could achieve the desired outcome. Any suggestions would be greatly appreciated!

Answer №1

I can easily do that without encountering any issues.
I am not originally from India.
Here is the code snippet I used:

from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.options import Options

options = Options()
options.add_argument("start-maximized")

webdriver_service = Service('C:\webdrivers\chromedriver.exe')
driver = webdriver.Chrome(options=options, service=webdriver_service)

url = "https://visa.vfsglobal.com/ind/en/pol/"
driver.get(url)

The outcome of this code is displayed below:

https://i.stack.imgur.com/eRlVj.png

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

The performance of the Python 2.7 DDos Script leaves much to be desired due

Currently, I am experimenting with creating a DDos Script for educational purposes. However, I have encountered a setback as it is operating at a slower pace and utilizing only around 0.8Mb of my upload speed out of the available 20Mb. UPDATE 3 To addres ...

What are the problems with Internet Explorer in Selenium WebDriver?

Currently dealing with a mouse-over issue in IE while using webdriver code. The functionality works smoothly in Chrome and Firefox, however, the problem arises only in IE. How can I resolve this? Initially focusing on an element and then clicking on a li ...

Refreshing frequency and reattempts when using selenium on a webpage

I am currently utilizing selenium with python to download a file from a URL. from selenium import webdriver profile = webdriver.FirefoxProfile() profile.set_preference('browser.download.folderList', 2) # custom location profile.set_preference(& ...

Python can be used to extract data from Highcharts through scraping techniques

I have been attempting to extract information from the chart located at . I made an effort to gather the data by utilizing the corresponding XPaths for the data in the sections, but unfortunately, it was not successful. I experimented with using Scrapy: d ...

Switch the type and version of the browser using Selenium

In an attempt to change my user agent using the Selenium Webdriver, I have utilized the following code. However, it has come to my attention that Google Analytics is able to easily detect my browser and its version (specifically Firefox 54.0 in this case). ...

Disabling the parent checkbox feature in PyGTK

I have successfully created a Treestore in pygtk, but I am facing an issue with a checkbox that I do not want to appear. It can be seen in the image below. Computer1 [ ]-----This checkbox is unwanted C drive [ ] D drive [ ] E drive [ ] Here i ...

Is there a way to retrieve the image tag's "src" value as a string from a Selenium Web Browser element?

I'm a beginner when it comes to Selenium and I'm currently working on trying to extract the "src" value from an IWebElement and then converting it into a string using C#. While I've managed to successfully retrieve simple text values from el ...

Combining two CSV files in Python and annotating any records that do not match in both the master and the additional

As a beginner in Python, I apologize if my question is not on point. I have two CSV files that are structured similarly and I need to match them. File 1 sa_name ABC DEF ACE ABCD BCD And File 2 rs_name ABCD CDE DEFG ABCDE ABE I want ...

Something went wrong while attempting to decode JSON in Python due to a missing comma delimiter

How can I send JSON data using sockets in Python? {"receiver": "2", "sender:": 1, "seq_num": 10, "data": "{"iv": "jdjhvwGriJ95kZwgDWlShw==", "ciphertext": "Fg7ugYYAn ...

Encountering a ClassCast Exception for Actions.movetoElement with Selenium version 3.14.0+ post selenium upgrade

After updating selenium to the newest version 3.14.0, I encountered a class cast exception with the following method: new Actions(driver).moveToElement(element).click().build().perform(); The error message reads: java.lang.ClassCastException: com.prahs.u ...

I have a dataset containing a JSON substring within one of the columns, and my goal is to extract the variables from it and create separate columns for each of them

imports json df = pd.read_json("C:/xampp/htdocs/PHP code/APItest.json", orient='records') print(df) https://i.stack.imgur.com/eJg1Y.png In order to enhance the data, I am looking to add three new columns: ['name','l ...

Using Python with Selenium to automate clicking the next post button on Instagram

Having trouble navigating to the next post on my Instagram bot. Here are my attempts: #First Attempt next_button = driver.find_element_by_class_name('wpO6b ') next_button.click() #Second Attempt _next = driver.find_element_by_class_name(' ...

Guide to interacting with webpage elements using Selenium and Python to trigger them based on their HTML properties

I have been struggling to locate this specific element using Python Selenium. Despite trying various methods like xpath, CSS selectors, and classes, I have not been able to find the element in question. Could anyone provide guidance on how to locate and cl ...

Using the pandas library, you can save and manage numerous data sets within a single h5 file by utilizing the pd

If I have two different dataframes, import pandas as pd df1 = pd.DataFrame({'col1':[0,2,3,2],'col2':[1,0,0,1]}) df2 = pd.DataFrame({'col12':[0,1,2,1],'col22':[1,1,1,1]}) After successfully storing df1 with the comm ...

Before the completion of the initial test, the second selenium test has already been initiated

I am facing an issue while running two Selenium tests sequentially. I have implemented waiters in the tests to wait for elements to become visible before interacting with them. Sometimes, the second test starts executing while the first test is still waiti ...

What is the best method to verify the presence of jQuery on a webpage using Python/Selenium WebDriver?

Our in-house automated testing framework is built using Selenium Webdriver in Python, with a mapping system linking object names to identifiers on webpages. However, we are encountering issues due to not waiting long enough for AJAX calls to complete, caus ...

"Troubleshooting: Login and network connectivity issues with Weights and Biases

Having recently set up Weights and Biases (wandb) to track the metrics of my machine learning projects, I encountered no issues when connected to the wandb cloud instance or when using a local docker image. However, upon attempting to access my local wandb ...

selenium problem: having trouble choosing an option from a dropdown menu when using thymeleaf

I am currently experiencing a dilemma when trying to select a value from a dropdown during a selenium test. I am retrieving my values from a properties file using thymeleaf in the following manner: <option th:each="medication : ${medications}" ...

Leveraging the Content-Length Header in Scrapy Requests

This is the specific page I am attempting to crawl, and this is the corresponding AJAX request that fetches the necessary data. I have replicated the same AJAX request with identical headers and request payload. While the request does not error out, it re ...

Tips for implementing an IF statement within a FOR loop to iterate through a DataFrame efficiently in Python

I am currently working on a task that involves selecting segments or clauses of sentences based on specific word pairs that these segments should start with. For instance, I'm only interested in sentence segments that begin with phrases like "what doe ...