小编Srk*_*rki的帖子

如何在Node js中将Buffer转换为base64图像

我从 SQL 数据库获取数据,如下所示:

const mysql = require("mysql");

const connection = mysql.createConnection({
    host: "localhost",
    user: "root",
    database: "database",
    password : ''
  });
  //connection.release();
  connection.connect(function(err) {
    if (err) console.log(err);
  });

  connection.query("SELECT image FROM table WHERE id=(SELECT max(id) FROM table);", function (err, result, fields) {
    if (err) console.log(err);
    console.log(result);
  });

/*Output:
[
  RowDataPacket {
    image: <Buffer 64 61 74 61 3a 69 6d 61 67 65 2f 6f 63 74 65 74 2d 73 74 72 65 61 6d 3b 62 61 73 …
Run Code Online (Sandbox Code Playgroud)

mysql sql base64 image node.js

7
推荐指数
1
解决办法
1万
查看次数

如何使用 Selenium 和 Python 单击#shadow-root(已关闭)内的按钮

我正在尝试单击#shadow-root (closed)iframe 内的按钮

<iframe title="recaptcha challenge expires in two minutes" 
   <div class="button-holder help-button-holder">
      #shadow-root (closed)
         <link rel="stylesheet" href="chrome-extension://mpbjkejclgfgadiemmefgebjfooflfhl/src/solve/solver-button.css">
         <button tabindex="0" title="Solve the challenge" id="solver-button"></button>
   </div>
</iframe>
Run Code Online (Sandbox Code Playgroud)

这就是我用来切换到 iframe 的方法

WebDriverWait(driver, 10).until(EC.frame_to_be_available_and_switch_to_it((By.XPATH,"//iframe[@title='recaptcha challenge expires in two minutes']")))
Run Code Online (Sandbox Code Playgroud)

我怎样才能点击//button[@id="solver-button"]

这是它的真实外观的照片

iframe-链接

按钮链接

python selenium selenium-chromedriver selenium-webdriver shadow-dom

6
推荐指数
1
解决办法
4526
查看次数