searchContent.js:9 POST localhost:3000/scrap 405 (Method Not Allowed)
getData @ searchContent.js:9
(anonymous) @ searchContent.js:29
commitHookEffectList @ react-dom.development.js:22030
commitPassiveHookEffects @ react-dom.development.js:22064
callCallback @ react-dom.development.js:336
invokeGuardedCallbackDev @ react-dom.development.js:385
invokeGuardedCallback @ react-dom.development.js:440
flushPassiveEffectsImpl @ react-dom.development.js:25392
unstable_runWithPriority @ scheduler.development.js:697
runWithPriority$2 @ react-dom.development.js:12149
flushPassiveEffects @ react-dom.development.js:25361
(anonymous) @ react-dom.development.js:25240
workLoop @ scheduler.development.js:641
flushWork @ scheduler.development.js:596
performWorkUntilDeadline @ scheduler.development.js:203
searchContent.js:20 Uncaught (in promise) SyntaxError: Unexpected end of JSON input
at getData (searchContent.js:20)
export default function GetContent() {
const [data, setData] = useState();
const getData = async() => {
const res = await fetch('/scrap', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
query: 'Ромашка',
type: 'ul'
})
});
const Data = await res.json();
console.log(Data);
setData(Data);
};
useEffect(() => {
getData().then(r => console.log(r));
}, []);
return (
<div>
{data}
</div>
)
}
C:\Users\History Developer\Desktop\Tor>tor
Mar 26 00:04:39.146 [notice] Tor 0.4.2.7 (git-74cad14699087b7e) running on Windows 8 [or later] with Libevent 2.1.8-stable, OpenSSL 1.1.1d, Zlib 1.2.11, Liblzma N/A, and Libzstd N/A.
Mar 26 00:04:39.147 [notice] Tor can't help you if you use it wrong! Learn how to be safe at https://www.torproject.org/download/download#warning
Mar 26 00:04:39.161 [notice] Configuration file "C:\Users\History Developer\AppData\Roaming\tor\torrc" not present, using reasonable defaults.
Mar 26 00:04:39.162 [warn] Path for GeoIPFile () is relative and will resolve to C:\Users\History Developer\Desktop\Tor\. Is this what you wanted?
Mar 26 00:04:39.163 [warn] Path for GeoIPv6File () is relative and will resolve to C:\Users\History Developer\Desktop\Tor\. Is this what you wanted?
Mar 26 00:04:39.165 [notice] Opening Socks listener on 127.0.0.1:9050
Mar 26 00:04:39.165 [warn] Could not bind to 127.0.0.1:9050: Address already in use [WSAEADDRINUSE ]. Is Tor already running?
Mar 26 00:04:39.166 [warn] Failed to parse/validate config: Failed to bind one of the listener ports.
Mar 26 00:04:39.166 [err] Reading config failed--see warnings above.
C:\Users\History Developer\Desktop\Tor>tor
Mar 26 00:05:03.617 [notice] Tor 0.4.2.7 (git-74cad14699087b7e) running on Windows 8 [or later] with Libevent 2.1.8-stable, OpenSSL 1.1.1d, Zlib 1.2.11, Liblzma N/A, and Libzstd N/A.
Mar 26 00:05:03.618 [notice] Tor can't help you if you use it wrong! Learn how to be safe at https://www.torproject.org/download/download#warning
Mar 26 00:05:03.631 [notice] Configuration file "C:\Users\History Developer\AppData\Roaming\tor\torrc" not present, using reasonable defaults.
Mar 26 00:05:03.632 [warn] Path for GeoIPFile () is relative and will resolve to C:\Users\History Developer\Desktop\Tor\. Is this what you wanted?
Mar 26 00:05:03.633 [warn] Path for GeoIPv6File () is relative and will resolve to C:\Users\History Developer\Desktop\Tor\. Is this what you wanted?
Mar 26 00:05:03.634 [notice] Opening Socks listener on 127.0.0.1:9050
Mar 26 00:05:03.634 [notice] Opened Socks listener on 127.0.0.1:9050
Mar 26 00:05:03.000 [notice] Bootstrapped 0% (starting): Starting
Mar 26 00:05:04.000 [notice] Starting with guard context "default"
Mar 26 00:05:05.000 [notice] Bootstrapped 5% (conn): Connecting to a relay
Mar 26 00:05:05.000 [notice] Bootstrapped 10% (conn_done): Connected to a relay
Mar 26 00:05:06.000 [notice] Bootstrapped 14% (handshake): Handshaking with a relay
Mar 26 00:05:06.000 [notice] Bootstrapped 15% (handshake_done): Handshake with a relay done
Mar 26 00:05:06.000 [notice] Bootstrapped 75% (enough_dirinfo): Loaded enough directory info to build circuits
Mar 26 00:05:06.000 [notice] Bootstrapped 90% (ap_handshake_done): Handshake finished with a relay to build circuits
Mar 26 00:05:06.000 [notice] Bootstrapped 95% (circuit_create): Establishing a Tor circuit
Mar 26 00:05:07.000 [notice] Bootstrapped 100% (done): Done
ControlPort 9051
HashedControlPassword 16:hash
async function Scrap(query, type) {
torridest.request(`https://www.rusprofile.ru/search?query=${encodeURI(query)}&search_inactive=0&type=${type || 'ul'}`, function (err, res, body) {
console.log(1);
return !err && res.statusCode === 200 ? console.log(body) : console.log(err);
});
}