get image frames webcam from server with selenium python script - python-2.7

I need to take image frames from a webcam server using selenium python module.
The frames webcam is show on the selenium browser ( using http:// .....html webpage) .
The source code of the page show me it's done using some java script.
I try to use:
capture_network_traffic() and captureNetworkTraffic
Not working , also I don't think is a good way to do that.
Also I don't want to use capture_screenshot functions , this take all canvas of the browser.
Any idea ?
Thank you. Regards.

First, what you'll need to do is navigate to the webpage with Selenium.
Then, analyse the web page source HTML which the Javascript will have rendered by you navigating to the page, to get the image URL. You can do this with Selenium or with an HTML parser.
Then you can easily download the image using wget or some other URL grabber.
You might not even need Selenium to accomplish this if when you get the page, the image is already there. If that is the case you can just use the URL grabber to get the page directly.
Let me know if you want more details or if you have any questions.

Related

Django Weasyprint Timeout error for loading images in log

and I made a project that takes some pictures and converts them to pdf using weasyprint library. everything is alright in localhost but when I deployed it in python anywhere it generates the pdf but pictures that supposed to be in it dosent display and just the replace string of them is in the pdf please help me
Weasyprint might not be able to load the pictures. Check that the URLs you give can be accessed by Weasyprint. When in doubt, try using data URIs which don't require loading over the network.

How to render a pdf file as pdf in browser using django

I am using Django web frame work. I am taking pdf files from users (notes/book/etc). Then I want to display those pdf in website, but I could not find a way. Methods that failed 1)iframe 2)simple rendering using django 3)pdf.js library. Also browser blocks rendering initially. Care to suggest a method and steps to implement it.
I the answer to your problem is here :
https://docs.djangoproject.com/en/3.0/howto/outputting-pdf/
Well the answer has to be very very clear here. You can not display pdf using. There is no such library for that. Like pdf.js for javascript based frameworks. I have done the research. So if you want a really good pdf viewer for your django powered website you have to use pdf.js for sure. I have asked people working with django professionally.
output in firefox
ouput in chromium browser
Now 2nd output is what we want
here is the code

How can I create a video and photo uploading feature on my website using Python and Django?

How can I create a video and photo uploading feature on my website using Python and Django?
I have using forms,models(file_field) and yet it doesn't render to the front_end
If you're using ImageField to upload to the server, make sure you have pillow installed. Your python may just be looking at a wrong path to search for your files. Secondly, you might want to consider your markup code, and make sure that there is space for your video to be uploaded. ie) , etc..

Access Webpage With Credentials and Cookies From Command Line

I am trying to access a proprietary website which provides access to a large database. The database is quite large (many billions of entries). Each entry in the database is a link to a webpage that is essentially a flat file containing the information that I need.
I have about 2000 entries from the database and their corresponding webpages in the database. I have two related issues that I am trying to resolve:
How to get wget (or any other similar program) to read cookie data. I downloaded my cookies from google chrome (using: https://chrome.google.com/webstore/detail/cookiestxt/njabckikapfpffapmjgojcnbfjonfjfg?hl=en) but for some reason the html downloaded by wget still cannot be rendered as a webpage. Similarly, I have not been able to get Google Chrome from the command line to read cookies. These cookies are needed to access the database, since they contain my credentials.
In my context, it would be OK if the webpage was downloaded as a PDF, but I cannot seem to figure out how to download a webpage as a pdf using wget or similar tools. I tried using automate-save-page-as (https://github.com/abiyani/automate-save-page-as) but I continuously get an error of the browser not being in my PATH.
I solved both of these issues:
Problem 1: I switched away from wget, curl and python's requests to simply using the selenium webdriver in python. Using selenium, I did not have to deal with issues such as passing cookies,headers, post and get, since it actually opens a browser. This also has a plus that as I was writing the script to use selenium, I could inspect the page and see what it was doing as it was doing it.
Problem 2: Selenium has a method called page_source, which downloaded the html of the webpage. When I tested it, it rendered the html correctly.

Cast image to ChromeCast

I am looking for an example of casting an image to a chrome cast from a url. There doesn't seem to be an image cast example in the google cast sample repositories but i feel this must have been done before.
I have little experience with the chrome cast sdk developer console as well as the development of the apps themselves so any information would be greatly appreciated.
I suggest you look at the CastHelloText-android (or ios) sample on out github repo. What you need to do is to use either a custom reeiver (say, start from the one used in CastHelloText) and add an image html tag and then use the cutom namespace data channel to send the url of your image to your receiver and set that as the source of your image tag. Alternatively, you can use a Styled (or the Default) receiver which supports showing images; create a MediaInfo from your image and just send load it like a video and that should work. Note that your image should be served from an accesisble web server.