VBA to read text from an already open webpage |
' Determine if a specific instance of IE is already open. |
Set objShell = CreateObject("Shell.Application") |
IE_count = objShell.Windows.Count |
For x = 0 To (IE_count - 1) |
On Error Resume Next ' sometimes more web pages are counted than are open |
my_url = objShell.Windows(x).Document.Location |
my_title = objShell.Windows(x).Document.Title |
'You can use my_title of my_url, whichever you want |
If my_title Like "Put your webpage title here" & "*" Then 'identify the existing web page |
Set ie = objShell.Windows(x) |
Exit For |
Else |
End If |
Next |
import sys from PyQt5.QtCore import QSize from PyQt5.QtGui import QImage, QPalette, QBrush from PyQt5.QtWidgets import * class MainWindow ( QWidget ): def __init__ ( self ): QWidget. __init__ ( self ) self .setGeometry( 100 , 100 , 300 , 200 ) oImage = QImage( "test.jpg" ) sImage = oImage.scaled(QSize( 300 , 200 )) # resize Image to widgets size palette = QPalette() palette.setBrush( 10 , QBrush(sImage)) # 10 = Windowrole self .setPalette(palette) self .show() if __name__ == "__main__" : app = QApplication(sys.argv) oMainwindow = MainWindow() sys.exit(app.exec_())
Comments
Post a Comment