The Google Chrome settings have the option to export passwords
I tried to search for import and could not find it
Is there a way to import passwords?
The word "hidden" should be deleted and then the import will appear
<button id="menuImportPassword" class="dropdown-item" hidden="" role="menuitem">
import
</button>
Related
in order to lighten my program and make it easy to use, I created an exe that centralizes all functions including the download of various applications and their installation. But the problem I face is that the link is dynamic (the link of the download page is fixed but not the download link). So how to get the second link on the page from the fixed link ?
For example, this link "https://anonfiles.com/D031ebu3uf/untitled.95_png" is fixed and I want to automate the recovery of the non-fixed link store in
<a target="_blank" type="button" id="download-url" class="btn btn-primary btn-block" href="https://cdn-31.anonfiles.com/D031ebu3uf/91f535ad-1619920351/untitled.95.png"> Download (365 KB)a></a>
Code:
url = 'https://anonfiles.com/D031ebu3uf/untitled.95_png'
r = requests.get(url, allow_redirects=True)
open('page.html', 'wb').write(r.content)
Use bS4 and requests. Download and parse the html. Use the id of the element to target it, then extract the href attribute:
import requests
from bs4 import BeautifulSoup as bs
r = requests.get('https://anonfiles.com/D031ebu3uf/untitled.95_png')
soup = bs(r.content, 'lxml')
link = soup.select_one('#download-url')['href']
print(link)
I am having issues clicking a button with Selenium. I have never worked with Selenium before, so I have tried searching the web for a solution but have had no luck. I tried some other things such as WebDriverWait but nothing has worked.
# My Code
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
import time
PATH = "F:\SeleniumProjects\chromedriver.exe"
options = webdriver.ChromeOptions()
options.add_argument("start-maximized");
options.add_argument("disable-infobars")
options.add_argument("--disable-extensions")
driver = webdriver.Chrome(options=options, executable_path=PATH)
driver.get("https://www.discord.com")
time.sleep(3)
buddy = driver.find_element_by_xpath("/html/body/div/div/div/div[1]/div[1]/header[1]/nav/div/a")
ActionChains(driver).move_to_element(buddy).click().perform()
This exception is confusing me because I know I can interact with it but I am unsure why it says it isn't. I am sure there is some simple fix but I am stumped.
selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable: https://discord.com/login has no size and location
(Session info: chrome=90.0.4430.93)
Here is the button I am trying to press
<a class="button-195cDm buttonWhite-18r1SC buttonSmall-2bnF7I gtm-click-class-login-button button-1x6X9g mobileAppButton-2dMGaq" href="//discord.com/login">Login</a>
Wrap a wait around it and the following should work:
buddy = WebDriverWait(driver,10).until(EC.visibility_of_element_located((By.XPATH, "//div[#class='appButton-2wSXh-']//a[contains(text(),'Login')]")))
buddy.click()
There are 2 elements of this on the page:
//a[contains(text(),'Login')]
That is why we need to go up one more level to the div element in the XPath
Import the following at the top of your script if they aren't there already:
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
The ActionChains is not needed, that is generally used for dropdown menus, things like that. Also your XPath was the full path in the HTML, that is generally not advisable and can be brittle.
This is what I've tried:
<button className="button">
<a
className="button"
href="../assets/Resume/ResumeOfficial.pdf"
download
>
Download Resume
</a>
</button>
It does try to download but it cannot find the file, yet I'm sure (like 99% unless I made some dumb mistake) that the address is correct.
<button className="button">
<a className="button" href="../assets/Resume/ResumeOfficial.pdf" download = "ResumeOfficial.pdf">
Download Resume
</a>
</button>
so this should solve your problem, generally for downloading .pdf always double check
Download
You can import same file in some variable and then you can use that variable in href it might work.
find below example:
<a href="variable_name" download>
I am trying to enter into the following web page in Python (https://power.larc.nasa.gov/data-access-viewer/). A confirmation page (let's say "Welcome to the power data access viewer!") appears simultaneously with the main page (let's say "Power Data Access Viewer"). I used the following code to close the confirmation page (by clicking on "Access Data" button), but I could not succeed. Any help is highly appreciated.
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
import time
driver = webdriver.Chrome()
driver.get('https://power.larc.nasa.gov/data-access-viewer/')
time.sleep(5)
driver.find_element_by_xpath("//*[#id='mysplash']/div[2]/div[2]").click()
Unfortunately, I received the error below. I have to add that two pages (main and confirmation pages) belong to two separate classes in one web-page, while I think there is a same class in case of "Alert&Popup". Thus, the "Switch-To" function did not work too. Furthermore, I applied "driver.window_handles" to get two pages address, but I received identical address.
Message: no such element: Unable to locate element: {"method":"xpath","selector":"//* [#id='mysplash']/div[2]/div[2]"}
Again, thanks your help in advance.
Illustration figure of the problem
You need wait, the confirmation page appears after a few moments and you can locate the element by css selector:
driver.get("https://power.larc.nasa.gov/data-access-viewer/")
element = WebDriverWait(driver, 30).until(EC.element_to_be_clickable((By.CSS_SELECTOR, 'div.enable-btn')))
element.click()
Following import:
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
I try to import some data from a secure site with sigh into a spreadsheet in Google Drive.
I can retrieve information like the title or some menus, but the private content returns #N/A value.
I have this chunk of html, and i need to get the Issues:
<div class="gh-box-section">
<ul class="gh-ul-aa">
<li>
<div class="gh-group">
<em>Bug:</em> 37
</div>
</li>
<li class="gh-summary">
<div class="gh-group">
<em>Total Issues:</em> 37
</div>
</li>
</ul>
I guess I can not get the sensitive information for some permission or login, I try to retrieve the information opening my session in one Chrome tab and make the import in another tab, but it did not work.
so, my question: is there a way to start a session for another site from Google Drive and import sensitive data from the html code?