This commit is contained in:
wassname
2024-12-23 21:12:48 +08:00
parent aca408d9ba
commit 62577711ba
5 changed files with 728 additions and 1086 deletions
+46
View File
@@ -0,0 +1,46 @@
<!doctype html>
<html lang=en>
<head>
<meta charset=utf-8>
<title>scraping reddit.com/r/rational recs</title>
<link href="https://cdn.datatables.net/v/dt/jq-3.7.0/dt-2.1.8/b-3.2.0/b-colvis-3.2.0/sc-2.4.3/sr-1.4.1/datatables.min.css" rel="stylesheet">
<script src="https://cdn.datatables.net/v/dt/jq-3.7.0/dt-2.1.8/b-3.2.0/b-colvis-3.2.0/sc-2.4.3/sr-1.4.1/datatables.min.js"></script>
</head>
<body>
<p>scraping <a href="https://old.reddit.com/r/rational/">reddit.com/r/rational/</a></p>
<a href="https://github.com/wassname/scrape_r_rational">source code</a>
<table id="myTable" class="cell-border compact stripe"></table>
</body>
<script>
let data = {{data}}
</script>
<script>
table = new DataTable('#myTable', {
data: data,
columns: {{columns}},
order: [[1, 'score']],
pageLength: 50,
responsive: true,
columnDefs: [
{
targets: 1,
className: 'noVis'
}
],
layout: {
topStart: {
buttons: [
{
extend: 'colvis',
columns: ':not(.noVis)',
popoverTitle: 'Column visibility selector'
}
]
}
}
});
</script>
</html>
+20
View File
@@ -176,6 +176,26 @@
"df_links.to_markdown('../outputs/links2.md')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"ename": "AttributeError",
"evalue": "'Series' object has no attribute 'to_html'",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m/tmp/ipykernel_2936525/1764501736.py\u001b[0m in \u001b[0;36m?\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mdf_links\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mto_html\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'../outputs/links2.html'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;32m/media/wassname/SGIronWolf/projects5/rrational/.venv/lib/python3.10/site-packages/pandas/core/generic.py\u001b[0m in \u001b[0;36m?\u001b[0;34m(self, name)\u001b[0m\n\u001b[1;32m 6295\u001b[0m \u001b[0;32mand\u001b[0m \u001b[0mname\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_accessors\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 6296\u001b[0m \u001b[0;32mand\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_info_axis\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_can_hold_identifiers_and_holds_name\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 6297\u001b[0m ):\n\u001b[1;32m 6298\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 6299\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mobject\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__getattribute__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mname\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;31mAttributeError\u001b[0m: 'Series' object has no attribute 'to_html'"
]
}
],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
+580 -306
View File
File diff suppressed because one or more lines are too long
Generated
+81 -780
View File
File diff suppressed because it is too large Load Diff
+1
View File
@@ -21,6 +21,7 @@ anycache = "^2.2.0"
# lightnovel-crawler = "^3.7.2"
tiktoken = "^0.8.0"
cloudscraper = "^1.2.71"
jinja2 = "^3.1.5"
[[tool.poetry.source]]
# pytorch cuda needs to compe from another source https://python-poetry.org/docs/dependency-specification/#source-dependencies