如果我查看页面源代码,我会看到
<script language="javascript" type="text/javascript">
styling += 'ul#topnav a.tabHeader5';
styling += '{';
styling += 'width: 142px;';
</script>
如果我通过 selenium 从该页面获取 html 源代码,我会看到
<style type=\"text/css\">\n\t\t\t\tul#topnav a.tabHeader5\n\t\t\t\t{\n\t\t\t\t\twidth: 142px;</style>
不明白为什么要从javascript改成css。
最佳答案
I don't understand why it is changed from javascript to css.
JavaScript 在执行时会更改 CSS。
关于javascript - 不同的 html 来源,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10143626/