Tengo un documento HTML que puedo abrir con el módulo webbrowser al especificarlo como la URL que quiero abrir, esto funciona bien. Quiero que este documento pueda actualizarse (de una forma distinta a la reapertura) con un script de Python que se ejecutará. Intenté establecer new = 0 en el módulo webbrowser, pero de todos modos solo abre una nueva pestaña en el navegador. ¿Hay alguna forma de lograr esto?Python refresh HTML document
5
A
Respuesta
0
Javascript:
setInterval(function(){ $.getJSON("/Command",function(data){ if(data.Refresh==1){ $('body').load('THE URL OF PAGE') ;// or location.reload(); } }); },1000);
/Command
está a cargo de Python para decirle al navegador qué debe hacer ..
Cuestiones relacionadas
- 1. onsubmit refresh html form
- 2. python refresh/reload
- 3. HTML generado para RichTextArea: ¿qué es #document?
- 4. python sax error "junk after document element"
- 5. cabecera Refresh
- 6. EHCache refresh
- 7. NCurses Refresh
- 8. Refresh Vim buffer
- 9. jQuery - multiple $ (document) .ready ...?
- 10. Twitter Bootsrap: Popover y Auto Refresh
- 11. WPF Refresh CollectionView sin recreación explícita (llamada al método Refresh())
- 12. Meta-refresh no funciona?
- 13. NSFetchedResultsController refresh refetch?
- 14. OpenLayers Refresh Strategy Problems
- 15. Pull to Refresh Javascript
- 16. Backbone refresh ver eventos
- 17. Jquery Waypoints Refresh
- 18. .NET Listview Refresh
- 19. PBS, refresh stdout
- 20. Jquery auto refresh div
- 21. segundo $ (document) evento ready jQuery
- 22. iTextsharp landscape document
- 23. Modernizr vs $ (document) .ready()
- 24. ABCPdf add document javascript
- 25. XML Document to String?
- 26. $ (document) .ready not Working
- 27. jQuery $ (document) .keydown() issues
- 28. Mongoose embedded document updating
- 29. $ (document) no .keydown trabajo
- 30. xampp change document root
Si * nuevo * es 0 se debe abrirlo en la misma pestaña - y no una nueva pestaña. AFAIK no hay otra manera de hacer esto. –
Necesita actualizar la página con algo de Javascript, que [es bastante simple] (http://www.google.ca/webhp?sourceid=chrome-instant&ix=seb&ie=UTF-8&ion=1#sclient=psy-ab&hl= es & site = webhp & source = hp & q = refresh% 20page% 20with% 20javascript & pbx = 1 & oq = & aq = & aqi = & aql = & gs_sm = & gs_upl = & fp = 24d5377621950837 & ion = 1 & ion = 1 & bav = on.2, or.r_gc.r_pw.r_cp., cf.osb & fp = 24d5377621950837 & biw = 1280 & bih = 679 & ion = 1). No hay forma de hacer esto con Python aparte de lo que ya has mencionado. – Bartek
Gracias, veré un poco de Javascript. –