Using Selenium to download .csv files from webpages - java

I'm trying to use Selenium and Java to download .csv files and then re-upload them. The program would visit a google doc with a list of urls. It would then visit each of these urls and click a hyperlink on each site to download a .csv file. It would then go to Google Drive and re-upload the .csv files as google spreadsheets.
Is this possible to accomplish with Selenium? If not, what is a better solution?
Thanks

Selenium is a library that interacts with a browser's DOM. It sounds like you are going to be doing none of that. You will be interacting with the local filesystem (not a browser DOM), accessing web links (very little to do with browser DOM), and reading .csv files (not a browser DOM).
You want to use Java and Google Drive API.

Related

Can we automate pdf using selenium?

Is there any way to get text from PDF pages using selenium/java apart from reading through input file stream?
In my application a report opens in PDF format, I need to get data from it.
When opened in Firefox it shows DOM structure but I wasn't able to locate element using that.
Big NO.Selenium automates browsers,Mock web applications, run tests. What you are asking is not the part of Selenium api. Third party api's are available that doesn't work 100%. check out
How to extract text from a PDF?

download excel files through a java applet using python

I'm trying to download thousands of Excel files from a website. I'd normally use urllib2 for this, but unfortunately the actual downloading takes place through a java applet and the urls don't change correspondingly. E.g., filling out a query and hitting download doesn't change the url until the file is actually downloading, and when it does change the url is always the same and doesn't change based on the query. So, in sum, I'm trying to download a bunch files which are normally queried through a java applet using python. Thanks in advance!

How can I open doc and ppt files without any app installed in device in Android?

How can I open doc, ppt files without any app installed in device in Android?
I am developing a document to go and I would like suggestions on how can I open doc, ppt, pdf file without any app installed.
if you want a readable output for those files, you kinda need another app. To my knowledge, stock android doesnt have a way to read any of those files nativly.
if you can manage one app, kingston office i know personally can open those types(pdf is iffy)
https://play.google.com/store/apps/details?id=cn.wps.moffice_eng&hl=en
The other way i think is if you had an external interpreter that can make a web page out of it. Maybe using drive.google.com would serve for that, but i dont know how far the browser on your device can go with it.

Extracting contents from a webpage and comparing using Java

I am developing a Java project in which i have a sub-module where i need to extract contents [text, image, color] from a webpage and compare it with another webpage. I am planning to use WinHTTrack software for downloading the webpage locally, but the problem is it doesn't save it as HTML. How can i download a webpage with HTML extension using softwares such as WinHTTrack [or just saving the webpage through ctrl+s is enogh.?]. Also i am planning to use HTML Parsers to extract the 3 content types[text, image, color],after downloading the webpage locally. So which parser to go with.?
WEll I use Httrack and it fetches html files as well. You are probably taking winhttrack project file as the only output file, but if you check inside the project directory there are html files (together with images, etc). I would suggest using - http://htmlparser.sourceforge.net/. It is a java library and since your project is a Java project it should be fairly easy to use it. You can also save the whole website locally using org.htmlparser.parserapplications.SiteCapturer (and specify whether resources such as images should be captured as well). Hope it helps.

Use Google Docs API to download file of any type

Is it possible to download files of any type from Google Docs using the Google Docs API? (jpg, zip, txt)
I can figure out how to download word, powerpoint, and excel files but want to be able to upload and download any type of file to Google Docs. I know it is possible to do this with the online uploader but can't seem to get the downloading part to work with the API.
I'm using the Java wrapper to the API. Is it possible to use the Java version of the API to download all file types?
Since the last answer was written, that API is deprecated. There's sample Java code on the Google Dev page for the (newer) Google Drive API for managing downloads from Google Docs.
This handles a large variety of MIME types.
See this page http://code.google.com/apis/documents/docs/3.0/developers_guide_protocol.html
and this for specifically downloading documents and files
http://code.google.com/apis/documents/docs/3.0/developers_guide_protocol.html#DownloadingDocsAndFiles
The document listing XML returned by google has file type and the URL to download the file in the node. You can use the URL to download the file contents.

Categories

Resources