How do I retrieve the information thats in the chrome "Source" tab with python? [closed] - python

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
For example when you go into chrome and open a website, then go to the devtools and open up the sources tab, how would i get basically everything that is in there myself with python? Like download it with python?

There are a few popular ways to interact with web content in Python, like controlling the browser with automation, for example with selenium. This will allow you to click and extract elements from a webpage. See this example.
An alternative would be to use a library like beautifulsoup to request the webpage and parse it within your Python script. This is usually the preferred method if you don't want the dependency of an actual browser (like in headless environments). More info in the official docs.

Related

HTML - How to scrape not visible elements using python? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
I'm using beautiful soup to scrape a webpages.
I am trying to scrape data from this https://painel-covid19.saude.ma.gov.br/vacinas. But the problem is I am getting the tags in outputs empty. In the Inspect Element I can see the data, but in page source not. You can see the code is hidden in . How can I retrieve it using python? Someone can help me?
The issue isn't "not visible". The issue is that the data is being filled in by Javascript code. You won't see the data unless you are executing the Javascript on the page. You can do that with the selenium package, which runs a copy of Chrome to do the rendering.

Selenium Python Upload Files To Google Keep [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
How to upload image files to google keep using selenium.
Please reply as soon as possible.
I have tried to find the hidden input tag but it was unsuccessful and I don't want to use pyautogui or any other GUI automation framework JUST SELENIUM.
Please reply as soon as possible.
Question is unclear. Selenium can't programmatically upload anything, you'd need a request framework to hit the Google Keep API (if there is one) to do that.
You can use Selenium to navigate the DOM of Google Keep and follow the exact same process as you would by doing it manually. However, once you're trying to find the files on disk, the prompt for this is no longer part of the DOM - I do not believe selenium can interact with this, it would still require manual intervention.
Based on this answer, and the other answers to the same question, https://stackoverflow.com/a/8852686/7532703 - it seems like people have had luck using AutoIT.
Edit from the comments:
I found this https://stackoverflow.com/a/33526707/7532703 - which uses a combination of Selenium and C# to interact with the dialog window, you'd have to either do this in C# or find something that you can do the same thing with in python

Is there a way to open a website and paste using python? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I have some code that relies on google maps to work. When you open Google Maps it opens a text-box. And the cursor is open to type. I am using the web browser module and the open function. How could I directly paste to the text-box?
Generally speaking, there is a way to open a website and paste using python with Selenium, and if you want to see it visually, you can use the web browser module in addition to Selenium.
Nevertheless, in your specific scenario, you want to access a Google service. I would recommend using its API over using Selenium and the webbrowser if you plan to use Google Maps continuously through automation. Google does own reCAPTCHA which Google will use against any bot-like activities. Again, I am not too sure what your usecase is, but I would generally use an available API over this Selenium automation.

Selenium / Web crawling / Web scraping App in Python [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I want to create a web app for my company that functions like a tool suite for non-technical employees to use. I'm using
Python
Selenium WebDriver,
BeautifulSoup,
Srapy,
Django
Is it possible and is this the right approach?
"The idea is to create a variety of methods that can be run by
clicking a button and/or inserting content in inputs, and having the
tests / functions run and returning the specified results."
Maybe Flask can help you here. It has a nice functionality to route urls to specific functions or methods in your code. It provides a convenient way to bind actions to code. You can search the web for how you can leverage Flask to cater to your specific needs, but here I just wanted to convey that it would help.

How to navigate a webpage with python [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I was made a python script for bruteforce (pen test) but before the bruteforce start, I need to go through some links clicking and login, so I want to do those stuff with python. Basically when I start that script it should login and click some links then start the bruteforce.
so, is there any way I can make my python script to do those basic stuff for me?
You might want to check these:
mechanize
Selenium
Spidermonkey
webkit
These tools will help you to emulate browser via script.

Categories