我们可以使用碎片,美味汤或硒来改变css,html值吗?

时间:2017-09-28 12:01:58

标签: python selenium automation beautifulsoup splinter

我可以使用更改任何html,css的值    我们可以用inspect元素做分裂或硒:

  `<form action="/action_page.php"
oninput="x.value=parseInt(a.value)+parseInt(b.value)">
  0
  <input type="range" id="a" name="a" value="50">
  100 +
  <input type="number" id="b" name="b" value="50">
  =
  <output name="x" for="a b"></output>
  <br><br>
  <input type="submit">
</form>`

我可以选择<input type="range" id="a" name="a" value="50">  并且可以通过使用splinter或selenium来改变value =“30”?

如果这是html代码:

<div class="medium-widget success-story-category">
                        <h2 class="widget-title"><span aria-hidden="true" class="icon-get-started"></span>Getting Started</h2>
<p>Python can be easy to pick up whether you're a first time programmer or you're experienced with other languages. The following pages are a useful first step to get on your way writing programs with Python!</p>
<ul>
    <li><a href="https://wiki.python.org/moin/BeginnersGuide/Programmers">Beginner's Guide, Programmers</a></li>
    <li><a href="https://wiki.python.org/moin/BeginnersGuide/NonProgrammers">Beginner's Guide, Non-Programmers</a></li>
    <li><a href="https://wiki.python.org/moin/BeginnersGuide/Download">Beginner's Guide, Download &amp; Installation</a></li>
    <li><a href="https://wiki.python.org/moin/BeginnersGuide/Examples">Code sample and snippets for Beginners</a></li>
</ul>

                    </div>
  • 我可以将<p>代码更改为<h1>吗?

  • 我们可以将现有标记添加到<p>标记

    <p style="color:red;">吗?

我试图查看this问题但未找到解决方案。

1 个答案:

答案 0 :(得分:0)

你不能用这些工具做到这一点。你需要使用JavaScript。