Which browser does the function ''webread'' use when it opens a webpage?
이전 댓글 표시
I'm trying to work with the html text of a webpage with a specific broswer. If applicable I would like to select the browser ''webread'' uses just like the function ''web'' allows it. Unfortunately, I cannot access the html text with the ''web'' function.
Moreover, if I can select the browser I want with the ''webread'' function, I would also like the access the webpage just as if I was using a VPN (I want to do a websearch and get results from another country).
Thank you
답변 (1개)
Mark Sherstan
2018년 12월 15일
[a, h] = web('http://google.com')
CurrentLocation= get(h, 'CurrentLocation') % Gives you location of current page
htmlText = get(h, 'HtmlText') % Gives you html content of current page
댓글 수: 6
Jerome Gosselin
2018년 12월 15일
Mark Sherstan
2018년 12월 15일
Handle to the most recent MATLAB web browser, returned as a scalar instance of the associated Java® class. If you specify the '-browser' option to open the page in a system browser, h is empty, ''.
If you add a delay without specifying the browser you can get the html info:
[a, h] = web('http://google.com')
CurrentLocation= get(h, 'CurrentLocation') % Gives you location of current page
pause(1)
htmlText = get(h, 'HtmlText') % Gives you html content of current page
keensword keensword
2019년 7월 4일
great! where can I find all the properties of this handle?
Nicholas Fugal
2021년 8월 2일
This doesn't address the question of using a browser other than the Matlab browser. I have a similar problem, but I need to use the system browser for authentication purposes. Using the matlab browser simply isn't an option.
Any hope for me getting the html contents of a web page using the system browser?
Rik
2021년 8월 2일
@Nicholas Fugal, I doubt there exists a supported solution. Any solution would require Matlab to have access to the actual contents of Chrome/Firefox/Edge, which would require a severe security issue in those browsers.
카테고리
도움말 센터 및 File Exchange에서 Adding custom doc에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!