@cvp In my version I can't instantiate the wkwebview due to the error that occurred and that I wrote in my previous post. I will try to solve the initial problem in another way if possible.
Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Latest posts made by lon2
-
RE: Pick file from page in ui.WebView
-
RE: Pick file from page in ui.WebView
@JonB the example you mentioned works for me too, but in that case I can't automate the Safari web view. I tried to use the wkwebview but I get the error 'wkwebview object has no attribute objc_instance' when running the script .. maybe because it is not compatible with the version of the python interpreter 3.5
-
RE: Pick file from page in ui.WebView
@mikael The upload of the photo to the page I want is not so easy to perform: there are dynamic and hidden parameters in the form, the url of the post request is not exposed, etc.. For these reasons, I had thought of automating the webview after having uploaded the photo manually ..but in this case I can't choose the photo from the iPhone gallery.
-
RE: Pick file from page in ui.WebView
@mikael my purpose was to automate the ui.webView using Javascript. I did this by inserting the ui.webView into a gui. You cannot set an input file field of an html page via JS so I thought of manually selecting the file by clicking on the upload button on the page. The code you sent me opens a view in Safari but I don't think I can automate it by putting it in another gui and then referencing it, right? ..there would be no problem if you can somehow automatically pick a file from the camera roll for the file input field of the html page.
-
RE: Pick file from page in ui.WebView
@mikael I created the ui.WebView by putting it in a gui and referencing it from the code (name = 'webview').
I don't use JS in this example.
I'm using iOS 10.3. An example code is this:#!python2 # coding: utf-8 import ui,requests, json, time, console, urllib, photos v = ui.load_view('dialog') v.present(style='full_screen') w=v['webview'] #ANY SITE THAT CONTAINS THE BUTTON TO UPLOAD A FILE w.load_url('http://www.htmldog.com/examples/inputfile/')
Thank you :)
PS: the menu to select a photo from the camera roll appears, but clicking on one of the options closes the gui.
-
Pick file from page in ui.WebView
Hi,If I click on the button to choose a file from a web page through the ui.webview component, the gui closes and no error is displayed nor can I choose a file .. is there any solution? Thank you