Ok, so I've looked around on how to do this and haven't really found an answer that showed me examples that I could work from.
What I'm trying to do is have a script that can do things like:
-Log into website
-Fill out forms or boxes etc.
Something simple that might help me in that I though of would be for example if I could write a script that would let me log into one if those text message websites like textnow or something like that, and then fill out a text message and send it to myself.
If anyone knows a good place that explains how to do something like this, or if anyone would be kind enough to give some guidance of their own then that would be greatly appreciated.
So after some good answers and further research, I have found that selenium is the thing that best suits my needs. It works not only with python, but supports other languages as well. If anyone else is looking for something that I had been when I asked the my question, a quick Google search for "selenium" should give them all the information they need about the tool that I found best for what I needed.
Related
I am new to web development, trying to make a image gallery and I can't figure out how to make the collection page.
Please include what do you want to do, what have you tried in order to do that and hopefully, where or what error message are you receiving.
Only then, me or someone will be able to help you.
If you don't know how to start, you are in the wrong place.
You should start watching some tutorial on youtube, then read some documentation and help yourself with more tutorials.
When you have a specific question, you come here.
:)
I am new with Python and am trying to create a program that will read in changing information from a webpage. I'm not sure if what I'm wanting to do is something simple or possible but in my head it seems do-able and relatively. Specifically I am interested in pulling in the song names from Pandora as they change. I have tried looking into just reading in information from a webpage using something like
import urllib
import re
page = urllib.urlopen("http://google.com").read()
re.findall("Shopping", page)
['Shopping']
page.find("Shopping")
However this isn't really what I'm wanting due to it getting information that doesn't change. Any advice or a link to helpful information about reading in changing info from a webpage would be greatly appreciated.
The only way this is possible (without some type of advanced algorithm) is if there are some elements of the page that do NOT change, which you can specify your program to look for. Otherwise, I believe you will need some sort of advanced logic. After all, computers can only do what we instruct them to do. Sorry :)
I'm learning a practice called 'web scraping' using python. From what I can tell so far the idea is to send out a request to load the site data from a server, store the DOM html in a variable, and then basically data mine the s*** out of the resulting string until you are able to quickly access exactly and only the information you need.
Well I'm ready to start fiddling with statements that might help me do the actual data mining, but first I need to see and understand all of the html in my string. After I've got the hang of it I won't care what the html looks like, but right now I need to be able to reference it to properly analyze my output. so far I've tried google, python.net, youtube, various blogs and etc. But they all look like alianeese.
I'm just looking for the typical stuff you know?
<html><head><meta><script src=""><style src=""><title></title></head><body><div class=""><img src=""></div><div><h1>my page</h1><li></li><li></li><li></li><li></li><li></li><li></li><p>click here</p></div></body></html>
You get what I'm saying? Just a website... that uses like... html... to render some simple structured data.
P.S. This is kind of neat. I went to give this post some tags and I discovered 'simple-html-dom'. So I googled it. Apparently it's some kind of language that lets you parse html from online sources in exactly the way I am trying to. I may check that out later, but I still want to figure out how to do this with python.
EDIT Actually something like this would work fine but it's just so big. I would prefer something smaller to work with.
While it would probably be nice to build your own web pages to use, you can also try looking for pages "optimized for lynx". Lynx is a text-only browser with which "simple" pages naturally work best.
Most of the links you'll find will be dead already, but I found this list for instance, which still has many alive and equally simple pages: http://www.put.com/dead.html (please ignore the content itself... there is no particular reason I chose this example other than that it probably works nicely for your purposes!)
I am a new user of python and would like to try subnets-resolver. However, I can`t find the documentation of this package. Can someone point me to it?
It seems you are out of luck. Google does not bring anything up, and the code contains no docstrings (quite unpythonic). You will have to figure it out yourself. You could write a documentation in the process and and make it available for others though.
I'm doing some crawling with Python, and would like to be able to identify (however imperfectly) the flash I come across - is it a video, an ad, a game, or whatever.
I assume I would have to decompile the swf, which seems doable. But what sort of processing would I do with the decompiled Actionscript to figure out what it's purpose is?
Edit: or any better ideas would be most welcome also.
I think your best bet would be to check the context where you see the swf file
usually they're embedded within web pages so if that page has 100 occurences of the word "game", then it might be a game, as an example
To detect an ad it might be trickier but i think that checking the domainname where the swf is hosted might do the trick, also html tags around the swf will be of great use
It might help to look at the arguments passed to the Flash movie. If there's reference to an FLV file then there's a good chance the SWF is being used to play a movie.
The path to the SWF might help too. If it's under, say an /ads directory then it's probably just a banner ad. Or if it's under /games then it's probably a game.
Other than using heuristics like this there's probably not much you can do. SWFs can be used for a lot of different things, and there's really nothing in the SWF itself that would tell you what "type" it is.
Tough one. I guess you should try find a scope for a swf context.
As you said, swfs can be: ads,games, video players, they can also contain experimental art.
who knows. Once you know what exactly your after, it should be easier to figure out how to look for that kind of data.
I think it would be easier to get started with commercial websites. Those need promotion, so if they might promotional ria's setup with a little bit of SEO in mind so look for things like swfobject, swfaddress and tracking stuff ( omniture and who knows what else ). They should have keywords in the embedding html.
Google and Yahoo are working with Adobe as far as I know to make SWFs indexable. There is something mentioned about a custom FlashPlayer used for Flash indexing in the Flash Internals presentation from Adobe MAX.
Hope it helps.