C#Selenium Chrome更改主页

时间:2017-09-14 17:33:03

标签: c# google-chrome selenium selenium-webdriver selenium-chromedriver

我正在尝试更改Chrome默认主页(谷歌标签),但我没有找到可行的解决方案。 我尝试了什么:

<table id="tbAplicaciones" align="center">
    <thead>
        <tr >
                <th width="10%" scope="col">id_solicita</th>
                <th width="10%" scope="col">Nombre</th>
                <th width="10%" scope="col">Destino</th>
                <th width="10%" scope="col">Folio</th>
                <th width="10%" scope="col">Fecha Pago</th>
                <th width="10%" scope="col">Cantidad Solicitada</th>
                <th width="10%" scope="col">Tipo de Gasto</th>
                <th width="10%" scope="col">Importe de Gasto</th>

            </tr>
    </thead>
    <tfoot>
         <?php
                        $id=0;
                        while ($clientes = pg_fetch_object($Cat))
                        {

                            if ($numfila == 0){ $class = "alt"; $numfila = 1; } else { $class = ""; $numfila = 0; }
                                echo "<tr class'".$class."' style=\"height: 5px;\">";
                                echo "<td align='center'>".$clientes->id_solicita."</td>";
                                   echo "<td>".utf8_decode($clientes->nombre)."</td>";
                                     echo "<td align='center'>".$clientes->destino."</td>";
                                     echo "<td align='center'>".$clientes->folio_gasto."</td>";
                                     echo "<td align='center'>".$clientes->fechapago."</td>";
                                     echo "<td align='center'>".$clientes->importe."</td>";
                                     echo "<td align='center'>".$clientes->tipogasto."</td>";
                                     echo "<td align='center'>".$clientes->importegasto."</td>";

                                echo "</tr>";
                                $id=$id+1;
                        }
                        if( $id == 0 )
                          // echo "Sin Sollicitudes Para Mostrar";
                        echo $usr2;
                        pg_close();
          ?>
    </tfoot>
    <tfoot>
</table>
</div> </body> </html> <?php
function ceros($numero, $ceros=2)
   {
     return sprintf("%0".$ceros."s", $numero );
   }?>
<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
 <script src="src/jquery.table2excel.js"></script>

1 个答案:

答案 0 :(得分:0)

在开始其余的Web自动化之前,您可以在初始化WebDriver之后导航到您想要的页面。

...
var _driver = new ChromeDriver(_options);
_driver.Navigate().GoToUrl("http://in.gr");

希望有所帮助。