1 回答

TA貢獻1862條經(jīng)驗 獲得超7個贊
在這里,試試這個:
CurBrowser.GetMainFrame().ExecuteJavaScriptAsync("var element = document.createElement('textarea'); element.value = document.getElementsByClassName('question-text')[0].innerText; document.body.appendChild(element); element.select(); document.execCommand('copy'); document.body.removeChild(element);");
Thread.Sleep(500);
Clipboard.ContainsText(TextDataFormat.Text);
string questionfromclipboard = Clipboard.GetText(TextDataFormat.Text);
MessageBox.Show(questionfromclipboard.ToString());
File.AppendAllText(@"C:\Users\RenoPC\Desktop\New Questions.txt", questionfromclipboard + Environment.NewLine);
添加回答
舉報