I have an automation project that requires opening the URL to a Microsoft SharePoint file and performing some action on the website instead of downloading it.
In my excel, if i "click" the hyperlink I can get directly opened up in the browser using the always open file option in chrome.
import pandas as pd
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.common.by import By
#url that generated from my Excel file containing hyperlink
df = pd.DataFrame(['https://company.sharepoint.com/sites/Test.xlsx', 'https://company.sharepoint.com/sites/Test2.xlsx'])
df.columns = ['url']
options = Options()
driver = webdriver.Chrome(options = options)
for url in df.url:
driver.get(url)
it just downloads the file instead of opening it in the browser if i code it using Selenium to open these url link