Is it possible to scrape mails within hotmail using Python? - python

Can this actually be done? Like checking if my browser is logged in and if so, scraw some of my emails? Or does hotmail prevent you from scraping your mails?

Yes actually very easily.
All you have to do is connect to a POP or IMAP(gmail,hotmail) and then manipulate data however you want.import smtplib
Here's a link documentation --- Stackoverflow question
--- POP -email --- Gmail
You can use regular expressions if you want to find something specific
Python RE-Regular Expressions
I don't know how would you check if you're already logged in, there isn't an obvious way to tell.
Of course it could be done but in some weird manner.

Related

Remove phone Discord.py

I am currently testing with different selfbots on Discord.py. I wanted to know if there was a way to remove the phone number off my account. I tried bot.remove_phone but that didnt work. I am completely new to python.
Self botting is against the Terms and Service of Discord.
Moreover, Discord doesn't give out features to further hurt their platform by their API. If Discord happens to detect this your account would be banned. Either way, remove_phone attribute is not included in the Official Discord documentation.
But for clarity, anything considered "user account automation" is disallowed, including custom clients and similar.
Here's Discord's reference:
https://support.discord.com/hc/en-us/articles/115002192352-Automated-user-accounts-self-bots-
I cant make an comment so I have to make an answer, but you could make an requests.delete() to discord, you need the token and its password.
You can find more info about how the request should look like by being logged in discord via chrome, then open dev tools with ctrl + i -> go to network and select XHR then you can try and delete phone number with a wrong password to get an idea how the request should look like
also probably should not use your main since you might do couple mistakes and lose your account

Is there an efficient way to have a Python bot use webpage search boxes?

I looked into this question which asked how a bot could input text on a webpage. One of the answers recommended using Selenium, but a comment there suggested using it was an inefficient way of accomplishing that task.
Say I wanted to create a bot that looks up a set of words on Wikipedia (using the search bar on Wikipedia) and gives me the first 20 words in each article. Would Selenium be the best tool for this?
(Note that I'm aware I could do this manually by just looking up https://en.wikipedia.org/wiki/<word I want> for each item in the list, but I'm specifically looking for how a bot would interact with search bars.)
Efficient and bot for what you're doing doesn't seem to intersect from what you described - why bother using a framework that renders the entire view as a human would see it when you are not using any of that visual content? The most efficient way to utilize a python bot to search on wiki would be to utilize the api and get the results as json to be parsed by the bot.
Searching Wikipedia using API
There is nothing magical about a search bar - when the input is put in there, the browser is redirected to the other url location as you stated https://en.wikipedia.org/wiki/<word you want>. I believe the inefficiency that is being referenced is this exact fact that you can just search manually without the search bar. Rendering and finding the bar to type something in and then submit takes hundreds of milliseconds. Searching directly on the API can be done in milliseconds - much more efficient.

How do I make Python urlib2 to cleverly avoid the security check while trying to log into a site?

I am trying to crawl a website for the first time. I am using urllib2 Python
I am currently trying to log into Foursquare social networking site using Python urlib2 and Beautifulsoup. To view a particular page, I need to provide username and password.
So,I followed the Basic Authentication described on the ducumentation page.
I guess, everything worked well, but the site throws up a security check asking me to type a text (capcha), before sending me the required page. It obviously looks like, the site is detecting that, a page is being requested not by a human, but a crawler.
So, what is the way, to avoid being detected. How to make urllib2 get the desired page, without having to stop at the security check? Pls help..
You probably want to use foursquare API instead.
You have to use the foursquare API. I guess, there is no other way. API are designed for such purposes.
Crawlers depending solely on the HTML format of the page will fail in the furture when the HTML page changes

Download from Megaupload with login - Python

It's my first question here.
Today, I've done a little application using wxPython: a simple Megaupload Downloader, but yet, it doesn't support premium accounts.
Now I would like to know how to download from MU with a login (free or premium user).
I'm very new to Python, so please don't be specific and "professional".
I used to download files with urlretrieve but, but is there a way to pass "arguments" or something to be able to log in as a premium user ?
Thank you. :D
EDIT =
News: new help needed xD
After trying with PyCUrl, htmllib2 and mechanize, I've done the login with urllib2 and cookiejar (the requested html says the username).
But when I start download a file, surely the server doesn't keep my login, in fact the downloaded file seems corrupted (I changed wait time from 45 to 25 seconds).
How can I download a file from MegaUpload keeping my previously done login? Thanks for your patient :D
Questions like this are usually frowned upon, they are very broad, and there are already an abundance of answers if you just search on google.
You can use urllib, or mechanize, or any library you can make an http post request with.
megaupload looks to have the form values
login:1
redir:1
username:
password:
just post those values at http://megaupload.com/?c=login
all you should have to do is set your username and password to the correct values!
For logging in using Python follow the following steps.
Find the list of parameters to be sent in the POST request and the url where the request has to be made by viewing the source of the login form. You may use a browser with "Inspect Element" feature to find it easily. [parameter name examples - userid, password]. Just check the tags name attribute.
Most of the sites set a cookie on logging in and the cookie has to be sent along with subsequent requests. To handle this download httllib2 (http://code.google.com/p/httplib2/ ) and read the wiki page on the link given. It has shown how to login with examples.
Now you can make subsequent requests for files, the cookies etc. will be handled automatically by httplib2.
i do alot of web stuff with python, i perfer using pycurl you can get it here
it is very simple to post data and login with curl, i've used it accross many languages such as PHP, python, and C++, hope this helps
You can use urllib this is a good example

Best Python Library for Downloading and Extracting Addresses

I've just been given a project which involves the following steps
Grab an email from a POP3 address
Open an attachment from the email
Extract the To: email address
Add this to a global suppression list
I'd like to try and do this in Python even though I could it in PHP in half the time (this is because I dont know anywhere near as much Python as PHP)
My question would be.
Can anyone recommend a Python library for interacting with email in the way described above?
Many thanks in advance
Two bits from the standard library: poplib to grab the email via POP3, email to slice and dice it as you wish.

Categories